Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
com.cloudera.impala.analysis.ToSqlTest Class Reference
Inheritance diagram for com.cloudera.impala.analysis.ToSqlTest:
Collaboration diagram for com.cloudera.impala.analysis.ToSqlTest:

Public Member Functions

void selectListTest ()
 
void TestTableAliases () throws AnalysisException
 
void TestStructFields () throws AnalysisException
 
void TestCollectionTableRefs () throws AnalysisException
 
void TestIdentifierQuoting ()
 
void whereTest ()
 
void joinTest ()
 
void planHintsTest ()
 
void aggregationTest ()
 
void orderByTest ()
 
void allTest ()
 
void unionTest ()
 
void valuesTest ()
 
void inlineViewTest ()
 
void subqueryTest ()
 
void withClauseTest ()
 
void insertTest ()
 
void testAnalyticExprs ()
 
void testExprs ()
 
void testDecimal ()
 
void testSet ()
 
void tearDown ()
 
ParseNode ParsesOk (String stmt)
 
ParseNode AnalyzesOk (String stmt)
 
ParseNode AnalyzesOk (String stmt, String expectedWarning)
 
ParseNode AnalyzesOk (String stmt, Analyzer analyzer, String expectedWarning)
 
ParseNode AnalyzesOk (String stmt, Analyzer analyzer)
 
void AnalysisError (String stmt)
 
void AnalysisError (String stmt, String expectedErrorString)
 
void AnalysisError (String stmt, Analyzer analyzer, String expectedErrorString)
 
void TestCompressedText () throws AnalysisException
 
void TestMemLayout () throws AnalysisException
 
void TestUnsupportedTypes ()
 
void TestBinaryHBaseTable ()
 
void TestUnsupportedSerde ()
 
void TestResetMetadata ()
 
void TestExplain ()
 
void TestLimitAndOffset ()
 
void TestAnalyzeShowCreateTable ()
 
void TestFunctionMatching ()
 

Protected Member Functions

Analyzer createAnalyzer (String defaultDb)
 
Analyzer createAnalyzer (TQueryOptions queryOptions)
 
Analyzer createAnalyzerUsingHiveColLabels ()
 
Function addTestFunction (String name, ArrayList< ScalarType > args, boolean varArgs)
 
Function addTestFunction (String name, ScalarType arg, boolean varArgs)
 
Function addTestFunction (String db, String fnName, ArrayList< ScalarType > args, boolean varArgs)
 
void addTestUda (String name, Type retType, Type...argTypes)
 
Db addTestDb (String dbName)
 
void clearTestDbs ()
 
Table addTestTable (String createTableSql)
 
void clearTestTables ()
 
void checkSelectToThrift (SelectStmt node)
 
void TblsAnalyzeOk (String query, TableName tbl)
 
void TblsAnalysisError (String query, TableName tbl, String expectedError)
 
void checkExprType (String query, Type type)
 

Protected Attributes

final List< DbtestDbs_ = Lists.newArrayList()
 
final List< TabletestTables_ = Lists.newArrayList()
 
Analyzer analyzer_
 

Static Protected Attributes

static final Logger LOG = LoggerFactory.getLogger(AnalyzerTest.class)
 
static ImpaladCatalog catalog_ = new ImpaladTestCatalog()
 
static Map< ScalarType, String > typeToLiteralValue_
 

Static Package Functions

 [static initializer]
 

Private Member Functions

void testToSql (String query, String expected)
 
void testToSql (String query, String defaultDb, String expected)
 
void runTestTemplate (String sql, String expectedSql, String[]...testDims)
 
void runTestTemplate (String sql, String expectedSql, int dim, Object[] testVector, String[]...testDims)
 
void TblsTestToSql (String query, TableName tbl, String expectedSql)
 
boolean isCollectionTableRef (String tableName)
 
void testAllTableAliases (String[] tables, String[] columns) throws AnalysisException
 
void testChildTableRefs (String childTable, String childColumn)
 

Static Private Member Functions

static
AnalysisContext.AnalysisResult 
analyze (String query, String defaultDb)
 

Static Private Attributes

static final String[] joinConditions_
 
static final String[] leftSemiJoinTypes_
 
static final String[] rightSemiJoinTypes_
 
static final String[] joinTypes_
 
static final String[] nonSemiJoinTypes_
 

Detailed Description

Definition at line 29 of file ToSqlTest.java.

Member Function Documentation

com.cloudera.impala.analysis.ToSqlTest.[static initializer] ( )
inlinestaticpackage
Db com.cloudera.impala.analysis.AnalyzerTest.addTestDb ( String  dbName)
inlineprotectedinherited
Function com.cloudera.impala.analysis.AnalyzerTest.addTestFunction ( String  name,
ArrayList< ScalarType args,
boolean  varArgs 
)
inlineprotectedinherited
Function com.cloudera.impala.analysis.AnalyzerTest.addTestFunction ( String  name,
ScalarType  arg,
boolean  varArgs 
)
inlineprotectedinherited
Function com.cloudera.impala.analysis.AnalyzerTest.addTestFunction ( String  db,
String  fnName,
ArrayList< ScalarType args,
boolean  varArgs 
)
inlineprotectedinherited

Definition at line 118 of file AnalyzerTest.java.

References com.cloudera.impala.catalog.Type.INT.

Table com.cloudera.impala.analysis.AnalyzerTest.addTestTable ( String  createTableSql)
inlineprotectedinherited

Add a new dummy table to the catalog based on the given CREATE TABLE sql. The dummy table only has the column definitions and no other metadata. Returns the new dummy table. The test tables are registered in testTables_ and removed in the method.

Definition at line 161 of file AnalyzerTest.java.

References com.cloudera.impala.analysis.AnalyzerTest.AnalyzesOk(), com.cloudera.impala.analysis.ColumnDef.getColName(), and com.cloudera.impala.analysis.CreateTableStmt.getTbl().

Referenced by com.cloudera.impala.analysis.AnalyzeStmtsTest.TestImplicitAndExplicitPaths(), com.cloudera.impala.analysis.AnalyzeStmtsTest.TestSlotRefPathAmbiguity(), com.cloudera.impala.analysis.AnalyzeStmtsTest.TestStarPathAmbiguity(), and com.cloudera.impala.analysis.AnalyzeStmtsTest.TestTableRefPathAmbiguity().

void com.cloudera.impala.analysis.AnalyzerTest.addTestUda ( String  name,
Type  retType,
Type...  argTypes 
)
inlineprotectedinherited
void com.cloudera.impala.analysis.ToSqlTest.aggregationTest ( )
inline
void com.cloudera.impala.analysis.ToSqlTest.allTest ( )
inline
void com.cloudera.impala.analysis.AnalyzerTest.AnalysisError ( String  stmt)
inlineinherited

Asserts if stmt passes analysis.

Definition at line 304 of file AnalyzerTest.java.

Referenced by com.cloudera.impala.analysis.AnalyzerTest.AnalysisError(), com.cloudera.impala.analysis.AnalyzeAuthStmtsTest.AnalyzeCreateDropRole(), com.cloudera.impala.analysis.AnalyzeAuthStmtsTest.AnalyzeGrantRevokePriv(), com.cloudera.impala.analysis.AnalyzeAuthStmtsTest.AnalyzeGrantRevokeRole(), com.cloudera.impala.analysis.AnalyzeAuthStmtsTest.AnalyzeShowGrantRole(), com.cloudera.impala.analysis.AnalyzeAuthStmtsTest.AnalyzeShowRoles(), com.cloudera.impala.analysis.AnalyzeExprsTest.DoNotTestStringLiteralToDateCasts(), com.cloudera.impala.analysis.AnalyzerTest.TblsAnalysisError(), com.cloudera.impala.analysis.AnalyzeStmtsTest.TestAggregates(), com.cloudera.impala.analysis.AnalyzeSubqueriesTest.TestAggregateSubqueries(), com.cloudera.impala.analysis.AnalyzeDDLTest.TestAlterTableAddDropPartition(), com.cloudera.impala.analysis.AnalyzeDDLTest.TestAlterTableAddReplaceColumns(), com.cloudera.impala.analysis.AnalyzeDDLTest.TestAlterTableChangeColumn(), com.cloudera.impala.analysis.AnalyzeDDLTest.TestAlterTableDropColumn(), com.cloudera.impala.analysis.AnalyzeDDLTest.TestAlterTableRename(), com.cloudera.impala.analysis.AnalyzeDDLTest.TestAlterTableSet(), com.cloudera.impala.analysis.AnalyzeDDLTest.TestAlterTableSetCached(), com.cloudera.impala.analysis.AnalyzeDDLTest.TestAlterView(), com.cloudera.impala.analysis.AnalyzeDDLTest.TestAlterViewRename(), com.cloudera.impala.analysis.AnalyzeExprsTest.TestAnalyticExprs(), com.cloudera.impala.analysis.AnalyzerTest.TestAnalyzeShowCreateTable(), com.cloudera.impala.analysis.AnalyzeExprsTest.TestAppxCountDistinctOption(), com.cloudera.impala.analysis.AnalyzeExprsTest.TestBetweenPredicates(), com.cloudera.impala.analysis.AnalyzeExprsTest.TestBinaryPredicates(), com.cloudera.impala.analysis.AnalyzeExprsTest.TestCaseExpr(), com.cloudera.impala.analysis.AnalyzeStmtsTest.TestCatalogTableRefs(), com.cloudera.impala.analysis.AnalyzeStmtsTest.testCollectionTableRefs(), com.cloudera.impala.analysis.AnalyzeStmtsTest.TestCollectionTableRefs(), com.cloudera.impala.analysis.AnalyzeExprsTest.TestComplexTypeCasts(), com.cloudera.impala.analysis.AnalyzeStmtsTest.TestComplexTypesInSelectList(), com.cloudera.impala.analysis.AnalyzeExprsTest.TestCompoundPredicates(), com.cloudera.impala.analysis.AnalyzeDDLTest.TestComputeIncrementalStats(), com.cloudera.impala.analysis.AnalyzeDDLTest.TestComputeStats(), com.cloudera.impala.analysis.AnalyzeExprsTest.TestConditionalExprs(), com.cloudera.impala.analysis.AnalyzeDDLTest.TestCreateAvroTest(), com.cloudera.impala.analysis.AnalyzeDDLTest.TestCreateDataSource(), com.cloudera.impala.analysis.AnalyzeDDLTest.TestCreateDb(), com.cloudera.impala.analysis.AnalyzeDDLTest.TestCreateTable(), com.cloudera.impala.analysis.AnalyzeDDLTest.TestCreateTableAsSelect(), com.cloudera.impala.analysis.AnalyzeDDLTest.TestCreateTableLike(), com.cloudera.impala.analysis.AnalyzeDDLTest.TestCreateTableLikeFile(), com.cloudera.impala.analysis.AnalyzeDDLTest.TestCreateView(), com.cloudera.impala.analysis.AnalyzeExprsTest.TestDecimalArithmetic(), com.cloudera.impala.analysis.AnalyzeExprsTest.TestDecimalCast(), com.cloudera.impala.analysis.AnalyzeExprsTest.TestDecimalCasts(), com.cloudera.impala.analysis.AnalyzeExprsTest.TestDecimalFunctions(), com.cloudera.impala.analysis.AnalyzeExprsTest.TestDecimalOperators(), com.cloudera.impala.analysis.AnalyzeExprsTest.TestDecodeExpr(), com.cloudera.impala.analysis.AnalyzeDDLTest.TestDescribe(), com.cloudera.impala.analysis.AnalyzeStmtsTest.TestDistinct(), com.cloudera.impala.analysis.AnalyzeStmtsTest.TestDistinctInlineView(), com.cloudera.impala.analysis.AnalyzeDDLTest.TestDrop(), com.cloudera.impala.analysis.AnalyzeDDLTest.TestDropIncrementalStats(), com.cloudera.impala.analysis.AnalyzeDDLTest.TestDropStats(), com.cloudera.impala.analysis.AnalyzeSubqueriesTest.TestExistsSubqueries(), com.cloudera.impala.analysis.AnalyzerTest.TestExplain(), com.cloudera.impala.analysis.AnalyzeExprsTest.TestExprChildLimit(), com.cloudera.impala.analysis.AnalyzeExprsTest.TestFixedPointArithmeticOps(), com.cloudera.impala.analysis.AnalyzeStmtsTest.TestFromClause(), com.cloudera.impala.analysis.AnalyzeExprsTest.testFuncExprDepthLimit(), com.cloudera.impala.analysis.AnalyzeExprsTest.TestFunctionCallExpr(), com.cloudera.impala.analysis.AnalyzeStmtsTest.TestFunctions(), com.cloudera.impala.analysis.AnalyzeStmtsTest.TestGroupBy(), com.cloudera.impala.analysis.AnalyzeStmtsTest.TestImplicitAndExplicitPaths(), com.cloudera.impala.analysis.AnalyzeExprsTest.testInfixExprDepthLimit(), com.cloudera.impala.analysis.AnalyzeStmtsTest.TestInlineView(), com.cloudera.impala.analysis.AnalyzeExprsTest.TestInPredicates(), com.cloudera.impala.analysis.AnalyzeStmtsTest.TestInsert(), com.cloudera.impala.analysis.AnalyzeStmtsTest.testInsertDynamic(), com.cloudera.impala.analysis.AnalyzeStmtsTest.TestInsertHints(), com.cloudera.impala.analysis.AnalyzeStmtsTest.testInsertStatic(), com.cloudera.impala.analysis.AnalyzeStmtsTest.testInsertUnpartitioned(), com.cloudera.impala.analysis.AnalyzeStmtsTest.testInsertWithPermutation(), com.cloudera.impala.analysis.AnalyzeSubqueriesTest.TestInSubqueries(), com.cloudera.impala.analysis.AnalyzeStmtsTest.TestJoinHints(), com.cloudera.impala.analysis.AnalyzeExprsTest.TestLikePredicates(), com.cloudera.impala.analysis.AnalyzerTest.TestLimitAndOffset(), com.cloudera.impala.analysis.AnalyzeStmtsTest.TestLoadData(), com.cloudera.impala.analysis.AnalyzeStmtsTest.TestNoFromClause(), com.cloudera.impala.analysis.AnalyzeExprsTest.TestNullFunctionArguments(), com.cloudera.impala.analysis.AnalyzeExprsTest.TestNumericLiteralMinMaxValues(), com.cloudera.impala.analysis.AnalyzeStmtsTest.TestOnClause(), com.cloudera.impala.analysis.AnalyzeStmtsTest.TestOrderBy(), com.cloudera.impala.analysis.AnalyzeStmtsTest.TestOrdinals(), com.cloudera.impala.analysis.AnalyzerTest.TestResetMetadata(), com.cloudera.impala.analysis.AnalyzeStmtsTest.TestSemiJoins(), com.cloudera.impala.analysis.AnalyzeDDLTest.TestShow(), com.cloudera.impala.analysis.AnalyzeDDLTest.TestShowFiles(), com.cloudera.impala.analysis.AnalyzeDDLTest.TestShowPartitions(), com.cloudera.impala.analysis.AnalyzeDDLTest.TestShowStats(), com.cloudera.impala.analysis.AnalyzeStmtsTest.TestSlotRefPathAmbiguity(), com.cloudera.impala.analysis.AnalyzeStmtsTest.TestStar(), com.cloudera.impala.analysis.AnalyzeStmtsTest.TestStarPathAmbiguity(), com.cloudera.impala.analysis.AnalyzeExprsTest.TestStringCasts(), com.cloudera.impala.analysis.AnalyzeStmtsTest.TestStructFields(), com.cloudera.impala.analysis.AnalyzeSubqueriesTest.TestSubqueries(), com.cloudera.impala.analysis.AnalyzeStmtsTest.TestTableRefPathAmbiguity(), com.cloudera.impala.analysis.AnalyzeExprsTest.TestTimestampArithmeticExpressions(), com.cloudera.impala.analysis.AnalyzeDDLTest.TestUda(), com.cloudera.impala.analysis.AnalyzeDDLTest.TestUdf(), com.cloudera.impala.analysis.AnalyzeExprsTest.TestUdfs(), com.cloudera.impala.analysis.AnalyzeStmtsTest.TestUnion(), com.cloudera.impala.analysis.AnalyzerTest.TestUnsupportedSerde(), com.cloudera.impala.analysis.AnalyzerTest.TestUnsupportedTypes(), com.cloudera.impala.analysis.AnalyzeDDLTest.TestUseDb(), com.cloudera.impala.analysis.AnalyzeStmtsTest.TestUsingClause(), com.cloudera.impala.analysis.AnalyzeStmtsTest.TestValuesStmt(), com.cloudera.impala.analysis.AnalyzeExprsTest.TestVarArgFunctions(), com.cloudera.impala.analysis.AnalyzeStmtsTest.TestViews(), com.cloudera.impala.analysis.AnalyzeStmtsTest.TestWhereClause(), com.cloudera.impala.analysis.AnalyzeStmtsTest.TestWithClause(), and com.cloudera.impala.analysis.AnalyzeDDLTest.TypeDefAnalysisError().

void com.cloudera.impala.analysis.AnalyzerTest.AnalysisError ( String  stmt,
String  expectedErrorString 
)
inlineinherited

Asserts if stmt passes analysis or the error string doesn't match and it is non-null.

Definition at line 319 of file AnalyzerTest.java.

References com.cloudera.impala.analysis.AnalyzerTest.AnalysisError(), com.cloudera.impala.analysis.AnalyzerTest.createAnalyzer(), and com.cloudera.impala.catalog.Catalog.DEFAULT_DB.

void com.cloudera.impala.analysis.AnalyzerTest.AnalysisError ( String  stmt,
Analyzer  analyzer,
String  expectedErrorString 
)
inlineinherited
static AnalysisContext.AnalysisResult com.cloudera.impala.analysis.ToSqlTest.analyze ( String  query,
String  defaultDb 
)
inlinestaticprivate
ParseNode com.cloudera.impala.analysis.AnalyzerTest.AnalyzesOk ( String  stmt)
inlineinherited

Analyze 'stmt', expecting it to pass. Asserts in case of analysis error.

Definition at line 252 of file AnalyzerTest.java.

References com.cloudera.impala.analysis.AnalyzerTest.createAnalyzer(), and com.cloudera.impala.catalog.Catalog.DEFAULT_DB.

Referenced by com.cloudera.impala.analysis.AnalyzerTest.addTestTable(), com.cloudera.impala.analysis.AuditingTest.AnalyzeAccessEvents(), com.cloudera.impala.analysis.AnalyzeAuthStmtsTest.AnalyzeCreateDropRole(), com.cloudera.impala.analysis.AnalyzeAuthStmtsTest.AnalyzeGrantRevokePriv(), com.cloudera.impala.analysis.AnalyzeAuthStmtsTest.AnalyzeGrantRevokeRole(), com.cloudera.impala.analysis.AnalyzeAuthStmtsTest.AnalyzeShowGrantRole(), com.cloudera.impala.analysis.AnalyzeAuthStmtsTest.AnalyzeShowRoles(), com.cloudera.impala.analysis.AnalyzerTest.AnalyzesOk(), com.cloudera.impala.analysis.AnalyzeExprsTest.assertCaseEquivalence(), com.cloudera.impala.analysis.AnalyzeDDLTest.checkComputeStatsStmt(), com.cloudera.impala.analysis.AnalyzerTest.checkExprType(), com.cloudera.impala.analysis.AnalyzeExprsTest.checkReturnType(), com.cloudera.impala.analysis.AnalyzerTest.TblsAnalyzeOk(), com.cloudera.impala.analysis.ToSqlTest.TblsTestToSql(), com.cloudera.impala.analysis.AnalyzeStmtsTest.TestAggregates(), com.cloudera.impala.analysis.AnalyzeSubqueriesTest.TestAggregateSubqueries(), com.cloudera.impala.analysis.AnalyzeStmtsTest.testAllTableAliases(), com.cloudera.impala.analysis.AnalyzeDDLTest.TestAlterTableAddDropPartition(), com.cloudera.impala.analysis.AnalyzeDDLTest.TestAlterTableAddReplaceColumns(), com.cloudera.impala.analysis.AnalyzeDDLTest.TestAlterTableChangeColumn(), com.cloudera.impala.analysis.AnalyzeDDLTest.TestAlterTableDropColumn(), com.cloudera.impala.analysis.AnalyzeDDLTest.TestAlterTableRename(), com.cloudera.impala.analysis.AnalyzeDDLTest.TestAlterTableSet(), com.cloudera.impala.analysis.AnalyzeDDLTest.TestAlterTableSetCached(), com.cloudera.impala.analysis.AnalyzeDDLTest.TestAlterView(), com.cloudera.impala.analysis.AnalyzeDDLTest.TestAlterViewRename(), com.cloudera.impala.analysis.AnalyzeExprsTest.TestAnalyticExprs(), com.cloudera.impala.analysis.AnalyzerTest.TestAnalyzeShowCreateTable(), com.cloudera.impala.analysis.AnalyzeExprsTest.TestAppxCountDistinctOption(), com.cloudera.impala.analysis.AnalyzeExprsTest.TestBetweenPredicates(), com.cloudera.impala.analysis.AnalyzerTest.TestBinaryHBaseTable(), com.cloudera.impala.analysis.AnalyzeExprsTest.TestBinaryPredicates(), com.cloudera.impala.analysis.AnalyzeExprsTest.TestBooleanValueExprs(), com.cloudera.impala.analysis.AnalyzeExprsTest.TestCaseExpr(), com.cloudera.impala.analysis.AnalyzeStmtsTest.TestCatalogTableRefs(), com.cloudera.impala.analysis.AnalyzeStmtsTest.TestCollectionTableRefs(), com.cloudera.impala.analysis.AnalyzeExprsTest.TestCompoundPredicates(), com.cloudera.impala.analysis.AnalyzerTest.TestCompressedText(), com.cloudera.impala.analysis.AnalyzeDDLTest.TestComputeStats(), com.cloudera.impala.analysis.AnalyzeExprsTest.TestConditionalExprs(), com.cloudera.impala.analysis.AnalyzeDDLTest.TestCreateAvroTest(), com.cloudera.impala.analysis.AnalyzeDDLTest.TestCreateDataSource(), com.cloudera.impala.analysis.AnalyzeDDLTest.TestCreateDb(), com.cloudera.impala.analysis.AnalyzeDDLTest.TestCreateTable(), com.cloudera.impala.analysis.AnalyzeDDLTest.TestCreateTableAsSelect(), com.cloudera.impala.analysis.AnalyzeDDLTest.TestCreateTableLike(), com.cloudera.impala.analysis.AnalyzeDDLTest.TestCreateTableLikeFile(), com.cloudera.impala.analysis.AnalyzeDDLTest.TestCreateView(), com.cloudera.impala.analysis.AnalyzeExprsTest.TestDecimalArithmetic(), com.cloudera.impala.analysis.AnalyzeExprsTest.TestDecimalCast(), com.cloudera.impala.analysis.AnalyzeExprsTest.TestDecimalCasts(), com.cloudera.impala.analysis.AnalyzeExprsTest.testDecimalExpr(), com.cloudera.impala.analysis.AnalyzeExprsTest.TestDecimalFunctions(), com.cloudera.impala.analysis.AnalyzeExprsTest.TestDecimalOperators(), com.cloudera.impala.analysis.AnalyzeExprsTest.TestDecodeExpr(), com.cloudera.impala.analysis.AnalyzeDDLTest.TestDescribe(), com.cloudera.impala.analysis.AnalyzeStmtsTest.TestDistinct(), com.cloudera.impala.analysis.AnalyzeStmtsTest.TestDistinctInlineView(), com.cloudera.impala.analysis.AnalyzeDDLTest.TestDrop(), com.cloudera.impala.analysis.AnalyzeDDLTest.TestDropIncrementalStats(), com.cloudera.impala.analysis.AnalyzeDDLTest.TestDropStats(), com.cloudera.impala.analysis.AnalyzeSubqueriesTest.TestExistsSubqueries(), com.cloudera.impala.analysis.AnalyzerTest.TestExplain(), com.cloudera.impala.analysis.AnalyzeExprsTest.testExprCast(), com.cloudera.impala.analysis.AnalyzeExprsTest.TestExprChildLimit(), com.cloudera.impala.analysis.AnalyzeStmtsTest.TestFromClause(), com.cloudera.impala.analysis.AnalyzeExprsTest.testFuncExprDepthLimit(), com.cloudera.impala.analysis.AnalyzeExprsTest.TestFunctionCallExpr(), com.cloudera.impala.analysis.AnalyzeStmtsTest.TestFunctions(), com.cloudera.impala.analysis.AnalyzeStmtsTest.TestGroupBy(), com.cloudera.impala.analysis.AnalyzeExprsTest.testInfixExprDepthLimit(), com.cloudera.impala.analysis.AnalyzeStmtsTest.TestInlineView(), com.cloudera.impala.analysis.AnalyzeExprsTest.TestInPredicates(), com.cloudera.impala.analysis.AnalyzeStmtsTest.TestInsert(), com.cloudera.impala.analysis.AnalyzeStmtsTest.testInsertDynamic(), com.cloudera.impala.analysis.AnalyzeStmtsTest.TestInsertHints(), com.cloudera.impala.analysis.AnalyzeStmtsTest.testInsertStatic(), com.cloudera.impala.analysis.AnalyzeStmtsTest.testInsertUnpartitioned(), com.cloudera.impala.analysis.AnalyzeStmtsTest.testInsertWithPermutation(), com.cloudera.impala.analysis.AnalyzeSubqueriesTest.TestInSubqueries(), com.cloudera.impala.analysis.AnalyzeExprsTest.TestIsNullPredicates(), com.cloudera.impala.analysis.AnalyzeStmtsTest.TestJoinHints(), com.cloudera.impala.analysis.AnalyzeExprsTest.TestLikePredicates(), com.cloudera.impala.analysis.AnalyzerTest.TestLimitAndOffset(), com.cloudera.impala.analysis.AnalyzeStmtsTest.TestLoadData(), com.cloudera.impala.analysis.AnalyzerTest.testMixedNullable(), com.cloudera.impala.analysis.AnalyzeStmtsTest.TestNoFromClause(), com.cloudera.impala.analysis.AnalyzerTest.testNonMaterializedSlots(), com.cloudera.impala.analysis.AnalyzerTest.testNonNullable(), com.cloudera.impala.analysis.AnalyzeExprsTest.TestNullFunctionArguments(), com.cloudera.impala.analysis.AnalyzeExprsTest.testNumericLiteral(), com.cloudera.impala.analysis.AnalyzeStmtsTest.TestOnClause(), com.cloudera.impala.analysis.AnalyzeStmtsTest.TestOrderBy(), com.cloudera.impala.analysis.AnalyzeStmtsTest.TestOrdinals(), com.cloudera.impala.analysis.AnalyzeDDLTest.TestPermissionValidation(), com.cloudera.impala.analysis.AnalyzerTest.TestResetMetadata(), com.cloudera.impala.analysis.AnalyzeStmtsTest.TestSelectListHints(), com.cloudera.impala.analysis.AnalyzerTest.testSelectStar(), com.cloudera.impala.analysis.AnalyzeStmtsTest.TestSemiJoins(), com.cloudera.impala.analysis.AnalyzeStmtsTest.TestSetQueryOption(), com.cloudera.impala.analysis.AnalyzeDDLTest.TestShow(), com.cloudera.impala.analysis.AnalyzeDDLTest.TestShowFiles(), com.cloudera.impala.analysis.AnalyzeDDLTest.TestShowPartitions(), com.cloudera.impala.analysis.AnalyzeDDLTest.TestShowStats(), com.cloudera.impala.analysis.AnalyzeStmtsTest.testSlotRefPath(), com.cloudera.impala.analysis.AnalyzeStmtsTest.TestSlotRefPathAmbiguity(), com.cloudera.impala.analysis.AnalyzeStmtsTest.TestStar(), com.cloudera.impala.analysis.AnalyzeStmtsTest.testStarPath(), com.cloudera.impala.analysis.AnalyzeStmtsTest.TestStarPathAmbiguity(), com.cloudera.impala.analysis.AnalyzeExprsTest.TestStringCasts(), com.cloudera.impala.analysis.AnalyzeSubqueriesTest.TestSubqueries(), com.cloudera.impala.analysis.AnalyzeStmtsTest.testTableRefPath(), com.cloudera.impala.analysis.AnalyzeStmtsTest.TestTableRefPathAmbiguity(), com.cloudera.impala.analysis.AnalyzeExprsTest.TestTimestampArithmeticExpressions(), com.cloudera.impala.analysis.AnalyzeExprsTest.TestTimestampValueExprs(), com.cloudera.impala.analysis.ToSqlTest.testToSql(), com.cloudera.impala.analysis.AnalyzeDDLTest.TestUda(), com.cloudera.impala.analysis.AnalyzeDDLTest.TestUdf(), com.cloudera.impala.analysis.AnalyzeExprsTest.TestUdfs(), com.cloudera.impala.analysis.AnalyzeStmtsTest.TestUnion(), com.cloudera.impala.analysis.AnalyzerTest.TestUnsupportedTypes(), com.cloudera.impala.analysis.AnalyzeDDLTest.TestUseDb(), com.cloudera.impala.analysis.AnalyzeDDLTest.TestUseStatement(), com.cloudera.impala.analysis.AnalyzeStmtsTest.TestUsingClause(), com.cloudera.impala.analysis.AnalyzeStmtsTest.TestValuesStmt(), com.cloudera.impala.analysis.AnalyzeExprsTest.TestVarArgFunctions(), com.cloudera.impala.analysis.AnalyzeStmtsTest.TestViews(), com.cloudera.impala.analysis.AnalyzeStmtsTest.TestWhereClause(), com.cloudera.impala.analysis.AnalyzeStmtsTest.TestWithClause(), com.cloudera.impala.analysis.AnalyzeExprsTest.typeCastTest(), and com.cloudera.impala.analysis.AnalyzeDDLTest.TypeDefsAnalyzeOk().

ParseNode com.cloudera.impala.analysis.AnalyzerTest.AnalyzesOk ( String  stmt,
String  expectedWarning 
)
inlineinherited

Analyze 'stmt', expecting it to pass. Asserts in case of analysis error. If 'expectedWarning' is not null, asserts that a warning is produced.

Definition at line 260 of file AnalyzerTest.java.

References com.cloudera.impala.analysis.AnalyzerTest.AnalyzesOk(), com.cloudera.impala.analysis.AnalyzerTest.createAnalyzer(), and com.cloudera.impala.catalog.Catalog.DEFAULT_DB.

ParseNode com.cloudera.impala.analysis.AnalyzerTest.AnalyzesOk ( String  stmt,
Analyzer  analyzer,
String  expectedWarning 
)
inlineinherited
ParseNode com.cloudera.impala.analysis.AnalyzerTest.AnalyzesOk ( String  stmt,
Analyzer  analyzer 
)
inlineinherited

Analyze 'stmt', expecting it to pass. Asserts in case of analysis error.

Definition at line 311 of file AnalyzerTest.java.

References com.cloudera.impala.analysis.AnalyzerTest.AnalyzesOk().

void com.cloudera.impala.analysis.AnalyzerTest.checkExprType ( String  query,
Type  type 
)
inlineprotectedinherited
void com.cloudera.impala.analysis.AnalyzerTest.clearTestDbs ( )
inlineprotectedinherited
void com.cloudera.impala.analysis.AnalyzerTest.clearTestTables ( )
inlineprotectedinherited
Analyzer com.cloudera.impala.analysis.AnalyzerTest.createAnalyzer ( TQueryOptions  queryOptions)
inlineprotectedinherited
Analyzer com.cloudera.impala.analysis.AnalyzerTest.createAnalyzerUsingHiveColLabels ( )
inlineprotectedinherited
void com.cloudera.impala.analysis.ToSqlTest.insertTest ( )
inline
boolean com.cloudera.impala.analysis.ToSqlTest.isCollectionTableRef ( String  tableName)
inlineprivate
void com.cloudera.impala.analysis.ToSqlTest.orderByTest ( )
inline
ParseNode com.cloudera.impala.analysis.AnalyzerTest.ParsesOk ( String  stmt)
inlineinherited

Parse 'stmt' and return the root ParseNode.

Definition at line 235 of file AnalyzerTest.java.

References gen_ir_descriptions.parser.

Referenced by com.cloudera.impala.analysis.AuditingTest.TestAccessEventsOnAuthFailure().

void com.cloudera.impala.analysis.ToSqlTest.planHintsTest ( )
inline

Tests that the toSql() of plan hints use the end-of-line commented hint style (for view compatibility with Hive) regardless of what style was used in the original query.

Definition at line 415 of file ToSqlTest.java.

References com.cloudera.impala.analysis.ToSqlTest.testToSql().

void com.cloudera.impala.analysis.ToSqlTest.runTestTemplate ( String  sql,
String  expectedSql,
String...[]  testDims 
)
inlineprivate
void com.cloudera.impala.analysis.ToSqlTest.runTestTemplate ( String  sql,
String  expectedSql,
int  dim,
Object[]  testVector,
String...[]  testDims 
)
inlineprivate
void com.cloudera.impala.analysis.ToSqlTest.selectListTest ( )
inline
void com.cloudera.impala.analysis.ToSqlTest.subqueryTest ( )
inline

Tests that toSql() properly handles subqueries in the where clause.

Definition at line 683 of file ToSqlTest.java.

References com.cloudera.impala.analysis.ToSqlTest.testToSql().

void com.cloudera.impala.analysis.AnalyzerTest.TblsAnalysisError ( String  query,
TableName  tbl,
String  expectedError 
)
inlineprotectedinherited
void com.cloudera.impala.analysis.AnalyzerTest.TblsAnalyzeOk ( String  query,
TableName  tbl 
)
inlineprotectedinherited

Generates and analyzes two variants of the given query by replacing all occurrences of "$TBL" in the query string with the unqualified and fully-qualified version of the given table name. The unqualified variant is analyzed using an analyzer that has tbl's db set as the default database. Example: query = "select id from $TBL, $TBL" tbl = "functional.alltypes" Variants generated and analyzed: select id from alltypes, alltypes (default db is "functional") select id from functional.alltypes, functional.alltypes (default db is "default")

Definition at line 360 of file AnalyzerTest.java.

References com.cloudera.impala.analysis.AnalyzerTest.AnalyzesOk(), com.cloudera.impala.analysis.AnalyzerTest.createAnalyzer(), and com.cloudera.impala.analysis.TableName.getDb().

Referenced by com.cloudera.impala.analysis.AnalyzeStmtsTest.testAllTableAliases(), and com.cloudera.impala.analysis.AnalyzeStmtsTest.testCollectionTableRefs().

void com.cloudera.impala.analysis.ToSqlTest.TblsTestToSql ( String  query,
TableName  tbl,
String  expectedSql 
)
inlineprivate

Generates and runs testToSql() on two variants of the given query by replacing all occurrences of "$TBL" in the query string with the unqualified and fully-qualified version of the given table name. The unqualified variant is analyzed using an analyzer that has tbl's db set as the default database. The SQL is expected to the same for both variants because toSql() should fully qualify unqualified table names. Example: query = "select id from $TBL, $TBL" tbl = "functional.alltypes" Variants generated and analyzed: select id from alltypes, alltypes (default db is "functional") select id from functional.alltypes, functional.alltypes (default db is "default")

Definition at line 135 of file ToSqlTest.java.

References com.cloudera.impala.analysis.AnalyzerTest.AnalyzesOk(), com.cloudera.impala.analysis.AnalyzerTest.createAnalyzer(), com.cloudera.impala.analysis.TableName.getDb(), and com.cloudera.impala.analysis.ToSqlTest.testToSql().

Referenced by com.cloudera.impala.analysis.ToSqlTest.testAllTableAliases(), and com.cloudera.impala.analysis.ToSqlTest.testChildTableRefs().

void com.cloudera.impala.analysis.AnalyzerTest.tearDown ( )
inlineinherited
void com.cloudera.impala.analysis.ToSqlTest.testAllTableAliases ( String[]  tables,
String[]  columns 
) throws AnalysisException
inlineprivate
void com.cloudera.impala.analysis.ToSqlTest.testAnalyticExprs ( )
inline
void com.cloudera.impala.analysis.AnalyzerTest.TestAnalyzeShowCreateTable ( )
inlineinherited
void com.cloudera.impala.analysis.AnalyzerTest.TestBinaryHBaseTable ( )
inlineinherited
void com.cloudera.impala.analysis.ToSqlTest.testChildTableRefs ( String  childTable,
String  childColumn 
)
inlineprivate

Tests the toSql() of the given child table and column assumed to be in functional.allcomplextypes, including different combinations of implicit/explicit aliases of the parent and child table.

Definition at line 225 of file ToSqlTest.java.

References com.cloudera.impala.analysis.ToSqlTest.joinTypes_, and com.cloudera.impala.analysis.ToSqlTest.TblsTestToSql().

Referenced by com.cloudera.impala.analysis.ToSqlTest.TestCollectionTableRefs().

void com.cloudera.impala.analysis.AnalyzerTest.TestCompressedText ( ) throws AnalysisException
inlineinherited
void com.cloudera.impala.analysis.ToSqlTest.testDecimal ( )
inline

Tests decimals are output correctly.

Definition at line 1023 of file ToSqlTest.java.

References com.cloudera.impala.analysis.ToSqlTest.testToSql().

void com.cloudera.impala.analysis.AnalyzerTest.TestExplain ( )
inlineinherited
void com.cloudera.impala.analysis.ToSqlTest.testExprs ( )
inline

Tests all expressions including whether their toSql() is properly enclosed in parentheses.

Definition at line 902 of file ToSqlTest.java.

References com.cloudera.impala.analysis.ToSqlTest.testToSql().

void com.cloudera.impala.analysis.ToSqlTest.TestIdentifierQuoting ( )
inline

Tests quoting of identifiers for view compatibility with Hive, and for proper quoting of Impala keywords in view-definition stmts.

Definition at line 341 of file ToSqlTest.java.

References com.cloudera.impala.analysis.ToSqlTest.testToSql().

void com.cloudera.impala.analysis.AnalyzerTest.TestLimitAndOffset ( )
inlineinherited
void com.cloudera.impala.analysis.AnalyzerTest.TestResetMetadata ( )
inlineinherited
void com.cloudera.impala.analysis.ToSqlTest.testSet ( )
inline

Tests set query option statements are output correctly.

Definition at line 1031 of file ToSqlTest.java.

References com.cloudera.impala.analysis.ToSqlTest.testToSql().

void com.cloudera.impala.analysis.ToSqlTest.TestStructFields ( ) throws AnalysisException
inline
void com.cloudera.impala.analysis.ToSqlTest.TestTableAliases ( ) throws AnalysisException
inline
void com.cloudera.impala.analysis.ToSqlTest.testToSql ( String  query,
String  defaultDb,
String  expected 
)
inlineprivate
void com.cloudera.impala.analysis.AnalyzerTest.TestUnsupportedSerde ( )
inlineinherited
void com.cloudera.impala.analysis.AnalyzerTest.TestUnsupportedTypes ( )
inlineinherited

We distinguish between three classes of unsupported types:

  1. Complex types, e.g., map For tables with such types we prevent loading the table metadata.
  2. Primitive types For tables with unsupported primitive types (e.g., binary) we can run queries as long as the unsupported columns are not referenced. We fail analysis if a query references an unsupported primitive column.
  3. Partition-column types We do not support table partitioning on timestamp columns

Definition at line 549 of file AnalyzerTest.java.

References com.cloudera.impala.analysis.AnalyzerTest.AnalysisError(), and com.cloudera.impala.analysis.AnalyzerTest.AnalyzesOk().

void com.cloudera.impala.analysis.ToSqlTest.unionTest ( )
inline
void com.cloudera.impala.analysis.ToSqlTest.valuesTest ( )
inline
void com.cloudera.impala.analysis.ToSqlTest.whereTest ( )
inline

Member Data Documentation

Analyzer com.cloudera.impala.analysis.AnalyzerTest.analyzer_
protectedinherited
final String [] com.cloudera.impala.analysis.ToSqlTest.joinConditions_
staticprivate
Initial value:
=
new String[] {"USING (id)", "ON (a.id = b.id)"}

Definition at line 32 of file ToSqlTest.java.

Referenced by com.cloudera.impala.analysis.ToSqlTest.inlineViewTest(), com.cloudera.impala.analysis.ToSqlTest.joinTest(), and com.cloudera.impala.analysis.ToSqlTest.withClauseTest().

final String [] com.cloudera.impala.analysis.ToSqlTest.joinTypes_
staticprivate
final String [] com.cloudera.impala.analysis.ToSqlTest.leftSemiJoinTypes_
staticprivate
Initial value:
=
new String[] {"LEFT SEMI JOIN", "LEFT ANTI JOIN"}

Definition at line 36 of file ToSqlTest.java.

Referenced by com.cloudera.impala.analysis.ToSqlTest.inlineViewTest(), and com.cloudera.impala.analysis.ToSqlTest.withClauseTest().

final Logger com.cloudera.impala.analysis.AnalyzerTest.LOG = LoggerFactory.getLogger(AnalyzerTest.class)
staticprotectedinherited

Definition at line 57 of file AnalyzerTest.java.

final String [] com.cloudera.impala.analysis.ToSqlTest.nonSemiJoinTypes_
staticprivate
final String [] com.cloudera.impala.analysis.ToSqlTest.rightSemiJoinTypes_
staticprivate
Initial value:
=
new String[] {"RIGHT SEMI JOIN", "RIGHT ANTI JOIN"}

Definition at line 40 of file ToSqlTest.java.

Referenced by com.cloudera.impala.analysis.ToSqlTest.inlineViewTest(), and com.cloudera.impala.analysis.ToSqlTest.withClauseTest().

final List<Db> com.cloudera.impala.analysis.AnalyzerTest.testDbs_ = Lists.newArrayList()
protectedinherited
final List<Table> com.cloudera.impala.analysis.AnalyzerTest.testTables_ = Lists.newArrayList()
protectedinherited
Map<ScalarType, String> com.cloudera.impala.analysis.AnalyzerTest.typeToLiteralValue_
staticprotectedinherited
Initial value:
=
new HashMap<ScalarType, String>()

Definition at line 67 of file AnalyzerTest.java.

Referenced by com.cloudera.impala.analysis.AnalyzeStmtsTest.TestAggregates().


The documentation for this class was generated from the following file: