@Translator(name="hive", description="A translator for hive based database on HDFS") public class HiveExecutionFactory extends JDBCExecutionFactory
JDBCExecutionFactory.StructRetrievalExecutionFactory.Format, ExecutionFactory.NullOrder, ExecutionFactory.SupportedJoinCriteria| Modifier and Type | Field and Description |
|---|---|
protected ConvertModifier |
convert |
static String |
HIVE |
DEFAULT_MAX_DEPENDENT_PREDICATES, DEFAULT_MAX_IN_CRITERIA, DEFAULT_TIME_ZONE, dialectDEFAULT_MAX_FROM_GROUPS, DEFAULT_MAX_IN_CRITERIA_SIZE| Constructor and Description |
|---|
HiveExecutionFactory() |
| Modifier and Type | Method and Description |
|---|---|
protected FunctionMethod |
addAggregatePushDownFunction(String qualifier,
String name,
String returnType,
String... paramTypes) |
boolean |
addSourceComment()
Returns true to indicate that SQL should include a comment
indicating the session and request ids.
|
protected JDBCMetdataProcessor |
createMetadataProcessor() |
String |
getLikeRegexString()
Get the predicate name for LIKE_REGEX
|
SQLConversionVisitor |
getSQLConversionVisitor()
Create the
SQLConversionVisitor that will perform translation. |
List<String> |
getSupportedFunctions()
Get list of all supported function names.
|
boolean |
hasTimeType()
Return false to indicate that time support should be emulated
with timestamps.
|
Object |
retrieveValue(ResultSet results,
int columnIndex,
Class<?> expectedType)
Retrieve the value on the current resultset row for the given column index.
|
void |
start()
Initialize the connector with supplied configuration
|
boolean |
supportsAggregatesEnhancedNumeric()
Support indicates connector can accept STDDEV_POP, STDDEV_VAR, VAR_POP, VAR_SAMP
|
boolean |
supportsBatchedUpdates()
Whether the source supports
BatchedUpdates |
boolean |
supportsBulkUpdate()
Whether the source supports updates with multiple value sets
|
boolean |
supportsCommonTableExpressions() |
boolean |
supportsCorrelatedSubqueries()
Support indicates connector can accept correlated subqueries wherever subqueries
are accepted
|
boolean |
supportsElementaryOlapOperations() |
boolean |
supportsExcept()
Support indicates that the connector supports the EXCEPT of two queries.
|
boolean |
supportsExistsCriteria()
Support indicates connector accepts the EXISTS criteria
|
boolean |
supportsGroupByRollup() |
boolean |
supportsInCriteriaSubquery()
Support indicates connector accepts IN criteria with a subquery on the right side
|
boolean |
supportsInlineViews()
Support indicates connector can accept inline views (subqueries
in the FROM clause).
|
boolean |
supportsInsertWithQueryExpression()
|
boolean |
supportsIntersect()
Support indicates that the connector supports the INTERSECT of two queries.
|
boolean |
supportsLikeCriteriaEscapeCharacter()
Support indicates connector accepts criteria of form (element LIKE constant ESCAPE char)
|
boolean |
supportsQuantifiedCompareCriteriaAll()
Support indicates connector accepts the quantified comparison criteria that
use ALL
|
boolean |
supportsQuantifiedCompareCriteriaSome()
Support indicates connector accepts the quantified comparison criteria that
use SOME
|
boolean |
supportsRowLimit()
Gets whether the connector can limit the number of rows returned by a query.
|
boolean |
supportsScalarSubqueries()
Support indicates connector can accept scalar subqueries in the SELECT, WHERE, and
HAVING clauses
|
boolean |
supportsUnions()
Support indicates that the connector supports the UNION of two queries.
|
List<?> |
translateCommand(Command command,
ExecutionContext context)
Return a List of translated parts (
LanguageObjects and Objects), or null
if to rely on the default translation. |
List<?> |
translateLimit(Limit limit,
ExecutionContext context)
Return a List of translated parts (
LanguageObjects and Objects), or null
if to rely on the default translation. |
String |
translateLiteralBoolean(Boolean booleanValue)
Subclasses should override this method to provide a different sql translation
of the literal boolean value.
|
String |
translateLiteralDate(Date dateValue)
Subclasses should override this method to provide a different sql translation
of the literal date value.
|
String |
translateLiteralTime(Time timeValue)
Subclasses should override this method to provide a different sql translation
of the literal time value.
|
String |
translateLiteralTimestamp(Timestamp timestampValue)
Subclasses should override this method to provide a different sql translation
of the literal timestamp value.
|
boolean |
useAnsiJoin()
Whether the source prefers to use ANSI style joins.
|
boolean |
useAsInGroupAlias()
Indicates whether group alias should be of the form
"...FROM groupA AS X" or "...FROM groupA X".
|
afterInitialConnectionObtained, bindValue, closeConnection, convertObject, createDirectExecution, createProcedureExecution, createResultSetExecution, createTempTable, createUpdateExecution, executeStoredProcedure, formatDateValue, getConnection, getCreateTemporaryTablePostfix, getCreateTemporaryTableString, getCreateTempTableSQL, getDatabaseCalendar, getDatabaseTimeZone, getDatabaseVersion, getDefaultNullOrder, getDefaultSupportedFunctions, getDialect, getFunctionModifiers, getHibernateDialectClassName, getMaxPreparedInsertBatchSize, getMetadata, getSetOperationString, getSourceComment, getStructRetrieval, getTemporaryTableName, getTimestampNanoPrecision, getVersion, initCapabilities, isEnableDependentJoins, isSourceRequired, isSourceRequiredForCapabilities, isTrimStrings, loadedTemporaryTable, obtainedConnection, parseName, registerFunctionModifier, registerSpecificTypeOfOutParameter, replaceElementName, retrieveValue, setDatabaseTimeZone, setDatabaseVersion, setDatabaseVersion, setEnableDependentJoins, setFetchSize, setMaxPreparedInsertBatchSize, setStructRetrieval, setTrimStrings, setUseBindVariables, setUseCommentsInSourceQuery, supportsAggregatesAvg, supportsAggregatesCount, supportsAggregatesCountStar, supportsAggregatesDistinct, supportsAggregatesMax, supportsAggregatesMin, supportsAggregatesSum, supportsAliasedTable, supportsCompareCriteriaEquals, supportsCompareCriteriaOrdered, supportsDependentJoins, supportsFullDependentJoins, supportsGeneratedKeys, supportsGeneratedKeys, supportsGroupBy, supportsHaving, supportsInCriteria, supportsIsNullCriteria, supportsLikeCriteria, supportsNotCriteria, supportsOrCriteria, supportsOrderByUnrelated, supportsSearchedCaseExpressions, supportsSelectExpression, supportsSelfJoins, supportsSetQueryOrderBy, tempTableRequiresTransaction, translate, useBindVariables, useCommentsInSourceQuery, useParensForJoins, useParensForSetQueries, usePreparedStatements, usesDatabaseVersion, useSelectLimit, useStreamsForLobs, useWithRollupaddPushDownFunction, areLobsUsableAfterClose, createExecution, getCacheDirective, getConnection, getDirectQueryProcedureName, getInstance, getLanguageFactory, getMaxDependentInPredicates, getMaxFromGroups, getMaxInCriteriaSize, getNativeQueryProcedureName, getPushDownFunctions, getSupportedJoinCriteria, getTypeFacility, isCopyLobs, isForkable, isImmutable, isSourceRequiredForMetadata, isThreadBound, requiresCriteria, setCopyLobs, setDirectQueryProcedureName, setImmutable, setMaxDependentInPredicates, setMaxInCriteriaSize, setNativeQueryProcedureName, setRequiresCriteria, setSourceRequired, setSourceRequiredForMetadata, setSupportedJoinCriteria, setSupportsDirectQueryProcedure, setSupportsFullOuterJoins, setSupportsInnerJoins, setSupportsNativeQueries, setSupportsOrderBy, setSupportsOuterJoins, setSupportsSelectDistinct, setThreadBound, supportsAdvancedOlapOperations, supportsArrayAgg, supportsArrayType, supportsConvert, supportsDirectQueryProcedure, supportsFormatLiteral, supportsFullOuterJoins, supportsFunctionsInGroupBy, supportsInnerJoins, supportsLikeRegex, supportsNativeQueries, supportsOnlyCorrelatedSubqueries, supportsOnlyFormatLiterals, supportsOnlyLiteralComparison, supportsOnlySingleTableGroupBy, supportsOrderBy, supportsOrderByNullOrdering, supportsOrderByWithExtendedGrouping, supportsOuterJoins, supportsRowOffset, supportsSelectDistinct, supportsSelectWithoutFrom, supportsSimilarTo, supportsStringAgg, supportsSubqueryInOn, supportsWindowDistinctAggregates, supportsWindowOrderByWithAggregatespublic static String HIVE
protected ConvertModifier convert
public void start()
throws TranslatorException
ExecutionFactorystart in class JDBCExecutionFactoryTranslatorExceptionpublic SQLConversionVisitor getSQLConversionVisitor()
JDBCExecutionFactorySQLConversionVisitor that will perform translation. Typical custom
JDBC connectors will not need to create custom conversion visitors, rather implementors
should override existing JDBCExecutionFactory methods.getSQLConversionVisitor in class JDBCExecutionFactorySQLConversionVisitorpublic boolean useAnsiJoin()
ExecutionFactoryuseAnsiJoin in class ExecutionFactory<DataSource,Connection>public boolean supportsCorrelatedSubqueries()
ExecutionFactorysupportsCorrelatedSubqueries in class JDBCExecutionFactorypublic boolean supportsExistsCriteria()
ExecutionFactorysupportsExistsCriteria in class JDBCExecutionFactorypublic boolean supportsInCriteriaSubquery()
ExecutionFactorysupportsInCriteriaSubquery in class JDBCExecutionFactorypublic boolean supportsLikeCriteriaEscapeCharacter()
ExecutionFactorysupportsLikeCriteriaEscapeCharacter in class JDBCExecutionFactorypublic boolean supportsQuantifiedCompareCriteriaAll()
ExecutionFactorysupportsQuantifiedCompareCriteriaAll in class JDBCExecutionFactorypublic boolean supportsQuantifiedCompareCriteriaSome()
ExecutionFactorysupportsQuantifiedCompareCriteriaSome in class JDBCExecutionFactorypublic boolean supportsBulkUpdate()
ExecutionFactorysupportsBulkUpdate in class JDBCExecutionFactorypublic boolean supportsBatchedUpdates()
ExecutionFactoryBatchedUpdatessupportsBatchedUpdates in class JDBCExecutionFactorypublic List<?> translateCommand(Command command, ExecutionContext context)
JDBCExecutionFactoryLanguageObjects and Objects), or null
if to rely on the default translation.translateCommand in class JDBCExecutionFactorypublic List<?> translateLimit(Limit limit, ExecutionContext context)
JDBCExecutionFactoryLanguageObjects and Objects), or null
if to rely on the default translation.translateLimit in class JDBCExecutionFactorypublic boolean addSourceComment()
JDBCExecutionFactoryaddSourceComment in class JDBCExecutionFactorypublic boolean useAsInGroupAlias()
JDBCExecutionFactoryuseAsInGroupAlias in class JDBCExecutionFactorypublic boolean hasTimeType()
JDBCExecutionFactoryhasTimeType in class JDBCExecutionFactorypublic String getLikeRegexString()
JDBCExecutionFactorygetLikeRegexString in class JDBCExecutionFactorypublic boolean supportsScalarSubqueries()
ExecutionFactorysupportsScalarSubqueries in class JDBCExecutionFactorypublic boolean supportsInlineViews()
ExecutionFactorysupportsInlineViews in class JDBCExecutionFactorypublic boolean supportsUnions()
ExecutionFactorysupportsUnions in class JDBCExecutionFactorypublic boolean supportsInsertWithQueryExpression()
ExecutionFactorySetQuery or SelectsupportsInsertWithQueryExpression in class JDBCExecutionFactorypublic boolean supportsIntersect()
ExecutionFactorysupportsIntersect in class ExecutionFactory<DataSource,Connection>public boolean supportsExcept()
ExecutionFactorysupportsExcept in class ExecutionFactory<DataSource,Connection>public boolean supportsAggregatesEnhancedNumeric()
ExecutionFactorysupportsAggregatesEnhancedNumeric in class ExecutionFactory<DataSource,Connection>public boolean supportsCommonTableExpressions()
supportsCommonTableExpressions in class ExecutionFactory<DataSource,Connection>public boolean supportsElementaryOlapOperations()
supportsElementaryOlapOperations in class ExecutionFactory<DataSource,Connection>public boolean supportsRowLimit()
ExecutionFactorysupportsRowLimit in class ExecutionFactory<DataSource,Connection>public boolean supportsGroupByRollup()
supportsGroupByRollup in class ExecutionFactory<DataSource,Connection>public String translateLiteralBoolean(Boolean booleanValue)
JDBCExecutionFactory'0' or '1'.translateLiteralBoolean in class JDBCExecutionFactorybooleanValue - Boolean value, never nullpublic String translateLiteralDate(Date dateValue)
JDBCExecutionFactory{d '2002-12-31'}translateLiteralDate in class JDBCExecutionFactorydateValue - Date value, never nullpublic String translateLiteralTime(Time timeValue)
JDBCExecutionFactory{t '23:59:59'}
See JDBCExecutionFactory.hasTimeType() to represent literal times as timestamps.translateLiteralTime in class JDBCExecutionFactorytimeValue - Time value, never nullpublic String translateLiteralTimestamp(Timestamp timestampValue)
JDBCExecutionFactory{ts '2002-12-31 23:59:59'}.
See JDBCExecutionFactory.getTimestampNanoPrecision() to control the literal
precision.translateLiteralTimestamp in class JDBCExecutionFactorytimestampValue - Timestamp value, never nullpublic List<String> getSupportedFunctions()
ExecutionFactorygetSupportedFunctions in class JDBCExecutionFactoryfor a listing of system pushdown functions. Note that
not all system functions are listed as some functions will use a common name
such as CONCAT vs. the || operator, and other functions will be rewritten and
not pushed down, such as SPACE.
Note: User defined functions should be specified fully qualified.protected JDBCMetdataProcessor createMetadataProcessor()
createMetadataProcessor in class JDBCExecutionFactorypublic Object retrieveValue(ResultSet results, int columnIndex, Class<?> expectedType) throws SQLException
JDBCExecutionFactoryretrieveValue in class JDBCExecutionFactorySQLExceptionprotected FunctionMethod addAggregatePushDownFunction(String qualifier, String name, String returnType, String... paramTypes)
Copyright © 2013 JBoss by Red Hat. All Rights Reserved.