Teiid 8.3.0.Final

org.teiid.translator.hive
Class HiveExecutionFactory

java.lang.Object
  extended by org.teiid.translator.ExecutionFactory<DataSource,Connection>
      extended by org.teiid.translator.jdbc.JDBCExecutionFactory
          extended by org.teiid.translator.hive.HiveExecutionFactory

@Translator(name="hive",
            description="A translator for hive based database on HDFS")
public class HiveExecutionFactory
extends JDBCExecutionFactory


Nested Class Summary
 
Nested classes/interfaces inherited from class org.teiid.translator.ExecutionFactory
ExecutionFactory.Format, ExecutionFactory.NullOrder, ExecutionFactory.SupportedJoinCriteria
 
Field Summary
protected  ConvertModifier convert
           
static String HIVE
           
 
Fields inherited from class org.teiid.translator.jdbc.JDBCExecutionFactory
DEFAULT_MAX_DEPENDENT_PREDICATES, DEFAULT_MAX_IN_CRITERIA, DEFAULT_TIME_ZONE
 
Fields inherited from class org.teiid.translator.ExecutionFactory
DEFAULT_MAX_FROM_GROUPS, DEFAULT_MAX_IN_CRITERIA_SIZE
 
Constructor Summary
HiveExecutionFactory()
           
 
Method Summary
 boolean addSourceComment()
          Returns true to indicate that SQL should include a comment indicating the session and request ids.
 String getLikeRegexString()
          Get the predicate name for LIKE_REGEX
 void getMetadata(MetadataFactory metadataFactory, Connection conn)
          Implement to provide metadata to the metadata for use by the engine.
 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.
 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 supportsExcept()
          Support indicates that the connector supports the EXCEPT of two queries.
 boolean supportsExistsCriteria()
          Support indicates connector accepts the EXISTS criteria
 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()
          Support indicates that the connector can accept INSERTs with values specified by a SetQuery or Select
 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 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".
 
Methods inherited from class org.teiid.translator.jdbc.JDBCExecutionFactory
afterInitialConnectionObtained, bindValue, closeConnection, createDirectExecution, createMetadataProcessor, createProcedureExecution, createResultSetExecution, createUpdateExecution, executeStoredProcedure, formatDateValue, getConnection, getDatabaseCalendar, getDatabaseTimeZone, getDatabaseVersion, getDefaultNullOrder, getDefaultSupportedFunctions, getFunctionModifiers, getMaxPreparedInsertBatchSize, getSetOperationString, getSourceComment, getTimestampNanoPrecision, isSourceRequired, isTrimStrings, obtainedConnection, parseName, registerFunctionModifier, registerSpecificTypeOfOutParameter, replaceElementName, retrieveValue, retrieveValue, setDatabaseTimeZone, setDatabaseVersion, setFetchSize, setMaxPreparedInsertBatchSize, setTrimStrings, setUseBindVariables, setUseCommentsInSourceQuery, supportsAggregatesAvg, supportsAggregatesCount, supportsAggregatesCountStar, supportsAggregatesDistinct, supportsAggregatesMax, supportsAggregatesMin, supportsAggregatesSum, supportsAliasedTable, supportsCompareCriteriaEquals, supportsCompareCriteriaOrdered, supportsGeneratedKeys, supportsGroupBy, supportsHaving, supportsInCriteria, supportsIsNullCriteria, supportsLikeCriteria, supportsNotCriteria, supportsOrCriteria, supportsOrderByUnrelated, supportsSearchedCaseExpressions, supportsSelectExpression, supportsSelfJoins, supportsSetQueryOrderBy, translate, useBindVariables, useCommentsInSourceQuery, useParensForJoins, useParensForSetQueries, usePreparedStatements, useSelectLimit, useStreamsForLobs
 
Methods inherited from class org.teiid.translator.ExecutionFactory
addPushDownFunction, areLobsUsableAfterClose, createExecution, getCacheDirective, getConnection, getInstance, getLanguageFactory, getMaxDependentInPredicates, getMaxFromGroups, getMaxInCriteriaSize, getNativeQueryProcedureName, getPushDownFunctions, getSupportedJoinCriteria, getTypeFacility, isCopyLobs, isForkable, isImmutable, isSourceRequiredForMetadata, requiresCriteria, setCopyLobs, setImmutable, setMaxDependentInPredicates, setMaxInCriteriaSize, setNativeQueryProcedureName, setRequiresCriteria, setSourceRequired, setSourceRequiredForMetadata, setSupportedJoinCriteria, setSupportsFullOuterJoins, setSupportsInnerJoins, setSupportsNativeQueries, setSupportsOrderBy, setSupportsOuterJoins, setSupportsSelectDistinct, supportsAdvancedOlapOperations, supportsArrayAgg, supportsArrayType, supportsConvert, supportsDependentJoins, supportsElementaryOlapOperations, supportsFormatLiteral, supportsFullOuterJoins, supportsFunctionsInGroupBy, supportsInnerJoins, supportsLikeRegex, supportsNativeQueries, supportsOnlyCorrelatedSubqueries, supportsOnlyFormatLiterals, supportsOnlyLiteralComparison, supportsOnlySingleTableGroupBy, supportsOrderBy, supportsOrderByNullOrdering, supportsOuterJoins, supportsRowLimit, supportsRowOffset, supportsSelectDistinct, supportsSimilarTo, supportsSubqueryInOn, supportsWindowDistinctAggregates, supportsWindowOrderByWithAggregates
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HIVE

public static String HIVE

convert

protected ConvertModifier convert
Constructor Detail

HiveExecutionFactory

public HiveExecutionFactory()
Method Detail

start

public void start()
           throws TranslatorException
Description copied from class: ExecutionFactory
Initialize the connector with supplied configuration

Overrides:
start in class JDBCExecutionFactory
Throws:
TranslatorException

getSQLConversionVisitor

public SQLConversionVisitor getSQLConversionVisitor()
Description copied from class: JDBCExecutionFactory
Create the SQLConversionVisitor that will perform translation. Typical custom JDBC connectors will not need to create custom conversion visitors, rather implementors should override existing JDBCExecutionFactory methods.

Overrides:
getSQLConversionVisitor in class JDBCExecutionFactory
Returns:
the SQLConversionVisitor

useAnsiJoin

public boolean useAnsiJoin()
Description copied from class: ExecutionFactory
Whether the source prefers to use ANSI style joins.

Overrides:
useAnsiJoin in class ExecutionFactory<DataSource,Connection>

supportsCorrelatedSubqueries

public boolean supportsCorrelatedSubqueries()
Description copied from class: ExecutionFactory
Support indicates connector can accept correlated subqueries wherever subqueries are accepted

Overrides:
supportsCorrelatedSubqueries in class JDBCExecutionFactory

supportsExistsCriteria

public boolean supportsExistsCriteria()
Description copied from class: ExecutionFactory
Support indicates connector accepts the EXISTS criteria

Overrides:
supportsExistsCriteria in class JDBCExecutionFactory

supportsInCriteriaSubquery

public boolean supportsInCriteriaSubquery()
Description copied from class: ExecutionFactory
Support indicates connector accepts IN criteria with a subquery on the right side

Overrides:
supportsInCriteriaSubquery in class JDBCExecutionFactory

supportsLikeCriteriaEscapeCharacter

public boolean supportsLikeCriteriaEscapeCharacter()
Description copied from class: ExecutionFactory
Support indicates connector accepts criteria of form (element LIKE constant ESCAPE char)

Overrides:
supportsLikeCriteriaEscapeCharacter in class JDBCExecutionFactory

supportsQuantifiedCompareCriteriaAll

public boolean supportsQuantifiedCompareCriteriaAll()
Description copied from class: ExecutionFactory
Support indicates connector accepts the quantified comparison criteria that use ALL

Overrides:
supportsQuantifiedCompareCriteriaAll in class JDBCExecutionFactory

supportsQuantifiedCompareCriteriaSome

public boolean supportsQuantifiedCompareCriteriaSome()
Description copied from class: ExecutionFactory
Support indicates connector accepts the quantified comparison criteria that use SOME

Overrides:
supportsQuantifiedCompareCriteriaSome in class JDBCExecutionFactory

supportsBulkUpdate

public boolean supportsBulkUpdate()
Description copied from class: ExecutionFactory
Whether the source supports updates with multiple value sets

Overrides:
supportsBulkUpdate in class JDBCExecutionFactory

supportsBatchedUpdates

public boolean supportsBatchedUpdates()
Description copied from class: ExecutionFactory
Whether the source supports BatchedUpdates

Overrides:
supportsBatchedUpdates in class JDBCExecutionFactory

translateCommand

public List<?> translateCommand(Command command,
                                ExecutionContext context)
Description copied from class: JDBCExecutionFactory
Return a List of translated parts (LanguageObjects and Objects), or null if to rely on the default translation.

Overrides:
translateCommand in class JDBCExecutionFactory
Returns:
a list of translated parts

translateLimit

public List<?> translateLimit(Limit limit,
                              ExecutionContext context)
Description copied from class: JDBCExecutionFactory
Return a List of translated parts (LanguageObjects and Objects), or null if to rely on the default translation.

Overrides:
translateLimit in class JDBCExecutionFactory
Returns:
a list of translated parts

addSourceComment

public boolean addSourceComment()
Description copied from class: JDBCExecutionFactory
Returns true to indicate that SQL should include a comment indicating the session and request ids.

Overrides:
addSourceComment in class JDBCExecutionFactory

useAsInGroupAlias

public boolean useAsInGroupAlias()
Description copied from class: JDBCExecutionFactory
Indicates whether group alias should be of the form "...FROM groupA AS X" or "...FROM groupA X". Certain data sources (such as Oracle) may not support the first form.

Overrides:
useAsInGroupAlias in class JDBCExecutionFactory
Returns:
boolean

hasTimeType

public boolean hasTimeType()
Description copied from class: JDBCExecutionFactory
Return false to indicate that time support should be emulated with timestamps.

Overrides:
hasTimeType in class JDBCExecutionFactory
Returns:
true if database has a time type

getLikeRegexString

public String getLikeRegexString()
Description copied from class: JDBCExecutionFactory
Get the predicate name for LIKE_REGEX

Overrides:
getLikeRegexString in class JDBCExecutionFactory
Returns:

supportsScalarSubqueries

public boolean supportsScalarSubqueries()
Description copied from class: ExecutionFactory
Support indicates connector can accept scalar subqueries in the SELECT, WHERE, and HAVING clauses

Overrides:
supportsScalarSubqueries in class JDBCExecutionFactory

supportsInlineViews

public boolean supportsInlineViews()
Description copied from class: ExecutionFactory
Support indicates connector can accept inline views (subqueries in the FROM clause).

Overrides:
supportsInlineViews in class JDBCExecutionFactory

supportsUnions

public boolean supportsUnions()
Description copied from class: ExecutionFactory
Support indicates that the connector supports the UNION of two queries.

Overrides:
supportsUnions in class JDBCExecutionFactory

supportsInsertWithQueryExpression

public boolean supportsInsertWithQueryExpression()
Description copied from class: ExecutionFactory
Support indicates that the connector can accept INSERTs with values specified by a SetQuery or Select

Overrides:
supportsInsertWithQueryExpression in class JDBCExecutionFactory

supportsIntersect

public boolean supportsIntersect()
Description copied from class: ExecutionFactory
Support indicates that the connector supports the INTERSECT of two queries.

Overrides:
supportsIntersect in class ExecutionFactory<DataSource,Connection>

supportsExcept

public boolean supportsExcept()
Description copied from class: ExecutionFactory
Support indicates that the connector supports the EXCEPT of two queries.

Overrides:
supportsExcept in class ExecutionFactory<DataSource,Connection>

supportsAggregatesEnhancedNumeric

public boolean supportsAggregatesEnhancedNumeric()
Description copied from class: ExecutionFactory
Support indicates connector can accept STDDEV_POP, STDDEV_VAR, VAR_POP, VAR_SAMP

Overrides:
supportsAggregatesEnhancedNumeric in class ExecutionFactory<DataSource,Connection>

supportsCommonTableExpressions

public boolean supportsCommonTableExpressions()
Overrides:
supportsCommonTableExpressions in class ExecutionFactory<DataSource,Connection>
Returns:
true if the WITH clause is supported

translateLiteralBoolean

public String translateLiteralBoolean(Boolean booleanValue)
Description copied from class: JDBCExecutionFactory
Subclasses should override this method to provide a different sql translation of the literal boolean value. By default, a boolean literal is represented as: '0' or '1'.

Overrides:
translateLiteralBoolean in class JDBCExecutionFactory
Parameters:
booleanValue - Boolean value, never null
Returns:
Translated string

translateLiteralDate

public String translateLiteralDate(Date dateValue)
Description copied from class: JDBCExecutionFactory
Subclasses should override this method to provide a different sql translation of the literal date value. By default, a date literal is represented as: {d '2002-12-31'}

Overrides:
translateLiteralDate in class JDBCExecutionFactory
Parameters:
dateValue - Date value, never null
Returns:
Translated string

translateLiteralTime

public String translateLiteralTime(Time timeValue)
Description copied from class: JDBCExecutionFactory
Subclasses should override this method to provide a different sql translation of the literal time value. By default, a time literal is represented as: {t '23:59:59'} See JDBCExecutionFactory.hasTimeType() to represent literal times as timestamps.

Overrides:
translateLiteralTime in class JDBCExecutionFactory
Parameters:
timeValue - Time value, never null
Returns:
Translated string

translateLiteralTimestamp

public String translateLiteralTimestamp(Timestamp timestampValue)
Description copied from class: JDBCExecutionFactory
Subclasses should override this method to provide a different sql translation of the literal timestamp value. By default, a timestamp literal is represented as: {ts '2002-12-31 23:59:59'}. See JDBCExecutionFactory.getTimestampNanoPrecision() to control the literal precision.

Overrides:
translateLiteralTimestamp in class JDBCExecutionFactory
Parameters:
timestampValue - Timestamp value, never null
Returns:
Translated string

getSupportedFunctions

public List<String> getSupportedFunctions()
Description copied from class: ExecutionFactory
Get list of all supported function names. Arithmetic functions have names like "+".

Overrides:
getSupportedFunctions in class JDBCExecutionFactory
See Also:
for 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.

getMetadata

public void getMetadata(MetadataFactory metadataFactory,
                        Connection conn)
                 throws TranslatorException
Description copied from class: ExecutionFactory
Implement to provide metadata to the metadata for use by the engine. This is the primary method of creating metadata for dynamic VDBs.

Overrides:
getMetadata in class JDBCExecutionFactory
conn - may be null if the source is not required
Throws:
TranslatorException - to indicate a recoverable error, otherwise a RuntimeException
See Also:
ExecutionFactory.isSourceRequiredForMetadata()

Teiid 8.3.0.Final

Copyright © 2013 JBoss by Red Hat. All Rights Reserved.