Search in sources :

Example 36 with DocTableRelation

use of io.crate.analyze.relations.DocTableRelation in project crate by crate.

the class ScalarTestCase method prepareFunctions.

@Before
public void prepareFunctions() {
    String createTableStmt = "create table doc.users (" + "  id int," + "  name text," + "  tags array(text)," + "  age int," + "  a int," + "  ip ip," + "  c char," + "  x bigint," + "  shape geo_shape," + "  timestamp_tz timestamp with time zone," + "  timestamp timestamp without time zone," + "  timezone text," + "  interval text," + "  time_format text," + "  long_array array(bigint)," + "  int_array array(int)," + "  short_array array(short)," + "  double_array array(double precision)," + "  regex_pattern text," + "  geoshape geo_shape," + "  geopoint geo_point," + "  geostring text," + "  is_awesome boolean," + "  double_val double precision," + "  float_val real," + "  short_val smallint," + "  obj object," + "  obj_ignored object(ignored)" + ")";
    DocTableInfo tableInfo = SQLExecutor.tableInfo(new RelationName(DocSchemaInfo.NAME, "users"), createTableStmt, clusterService);
    DocTableRelation tableRelation = new DocTableRelation(tableInfo);
    tableSources = Map.of(tableInfo.ident(), tableRelation);
    sqlExpressions = new SqlExpressions(tableSources);
    inputFactory = new InputFactory(sqlExpressions.nodeCtx);
}
Also used : InputFactory(io.crate.expression.InputFactory) DocTableInfo(io.crate.metadata.doc.DocTableInfo) RelationName(io.crate.metadata.RelationName) DocTableRelation(io.crate.analyze.relations.DocTableRelation) SqlExpressions(io.crate.testing.SqlExpressions) Before(org.junit.Before)

Aggregations

DocTableRelation (io.crate.analyze.relations.DocTableRelation)36 DocTableInfo (io.crate.metadata.doc.DocTableInfo)17 RelationName (io.crate.metadata.RelationName)13 AnalyzedRelation (io.crate.analyze.relations.AnalyzedRelation)10 Symbol (io.crate.expression.symbol.Symbol)10 CrateDummyClusterServiceUnitTest (io.crate.test.integration.CrateDummyClusterServiceUnitTest)10 SqlExpressions (io.crate.testing.SqlExpressions)10 Test (org.junit.Test)10 Before (org.junit.Before)9 ExpressionAnalysisContext (io.crate.analyze.expressions.ExpressionAnalysisContext)7 ExpressionAnalyzer (io.crate.analyze.expressions.ExpressionAnalyzer)7 EvaluatingNormalizer (io.crate.expression.eval.EvaluatingNormalizer)7 Reference (io.crate.metadata.Reference)6 SQLExecutor (io.crate.testing.SQLExecutor)6 WhereClause (io.crate.analyze.WhereClause)5 TableInfo (io.crate.metadata.table.TableInfo)4 QueriedSelectRelation (io.crate.analyze.QueriedSelectRelation)3 FullQualifiedNameFieldProvider (io.crate.analyze.relations.FullQualifiedNameFieldProvider)3 NameFieldProvider (io.crate.analyze.relations.NameFieldProvider)3 StatementAnalysisContext (io.crate.analyze.relations.StatementAnalysisContext)3