本文整理汇总了Java中org.apache.calcite.sql.validate.SqlConformance类的典型用法代码示例。如果您正苦于以下问题:Java SqlConformance类的具体用法?Java SqlConformance怎么用?Java SqlConformance使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SqlConformance类属于org.apache.calcite.sql.validate包,在下文中一共展示了SqlConformance类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: validate
import org.apache.calcite.sql.validate.SqlConformance; //导入依赖的package包/类
public SqlNode validate(SqlNode sqlNode) throws ValidationException {
ensure(State.STATE_3_PARSED);
final SqlConformance conformance = conformance();
final CalciteCatalogReader catalogReader = createCatalogReader();
this.validator =
new CalciteSqlValidator(operatorTable, catalogReader, typeFactory,
conformance);
this.validator.setIdentifierExpansion(true);
try {
validatedSqlNode = validator.validate(sqlNode);
} catch (RuntimeException e) {
throw new ValidationException(e);
}
state = State.STATE_4_VALIDATED;
return validatedSqlNode;
}
开发者ID:apache,项目名称:calcite,代码行数:17,代码来源:PlannerImpl.java
示例2: TesterImpl
import org.apache.calcite.sql.validate.SqlConformance; //导入依赖的package包/类
protected TesterImpl(DiffRepository diffRepos, boolean enableDecorrelate,
boolean enableTrim, boolean enableExpand, boolean enableLateDecorrelate,
Function<RelDataTypeFactory, Prepare.CatalogReader>
catalogReaderFactory,
Function<RelOptCluster, RelOptCluster> clusterFactory,
SqlToRelConverter.Config config, SqlConformance conformance,
Context context) {
this.diffRepos = diffRepos;
this.enableDecorrelate = enableDecorrelate;
this.enableTrim = enableTrim;
this.enableExpand = enableExpand;
this.enableLateDecorrelate = enableLateDecorrelate;
this.catalogReaderFactory = catalogReaderFactory;
this.clusterFactory = clusterFactory;
this.config = config;
this.conformance = conformance;
this.context = context;
}
开发者ID:apache,项目名称:calcite,代码行数:19,代码来源:SqlToRelTestBase.java
示例3: SqlConverter
import org.apache.calcite.sql.validate.SqlConformance; //导入依赖的package包/类
public SqlConverter(QueryContext context) {
this.settings = context.getPlannerSettings();
this.util = context;
this.functions = context.getFunctionRegistry();
this.parserConfig = new DrillParserConfig(settings);
this.sqlToRelConverterConfig = new SqlToRelConverterConfig();
this.isInnerQuery = false;
this.typeFactory = new JavaTypeFactoryImpl(DRILL_TYPE_SYSTEM);
this.defaultSchema = context.getNewDefaultSchema();
this.rootSchema = rootSchema(defaultSchema);
this.temporarySchema = context.getConfig().getString(ExecConstants.DEFAULT_TEMPORARY_WORKSPACE);
this.session = context.getSession();
this.drillConfig = context.getConfig();
this.catalog = new DrillCalciteCatalogReader(
rootSchema,
parserConfig.caseSensitive(),
DynamicSchema.from(defaultSchema).path(null),
typeFactory,
drillConfig,
session);
this.opTab = new ChainedSqlOperatorTable(Arrays.asList(context.getDrillOperatorTable(), catalog));
this.costFactory = (settings.useDefaultCosting()) ? null : new DrillCostBase.DrillCostFactory();
this.validator = new DrillValidator(opTab, catalog, typeFactory, SqlConformance.DEFAULT);
validator.setIdentifierExpansion(true);
}
开发者ID:axbaretto,项目名称:drill,代码行数:26,代码来源:SqlConverter.java
示例4: getSqlAdvisor
import org.apache.calcite.sql.validate.SqlConformance; //导入依赖的package包/类
private SqlAdvisor getSqlAdvisor() {
final CalciteConnectionImpl con = (CalciteConnectionImpl) queryProvider;
final String schemaName = con.getSchema();
final List<String> schemaPath =
schemaName == null
? ImmutableList.<String>of()
: ImmutableList.of(schemaName);
final SqlValidatorWithHints validator =
new SqlAdvisorValidator(SqlStdOperatorTable.instance(),
new CalciteCatalogReader(rootSchema, con.config().caseSensitive(),
schemaPath, typeFactory),
typeFactory, SqlConformance.DEFAULT);
return new SqlAdvisor(validator);
}
开发者ID:bitnine-oss,项目名称:octopus,代码行数:15,代码来源:CalciteConnectionImpl.java
示例5: createSqlValidator
import org.apache.calcite.sql.validate.SqlConformance; //导入依赖的package包/类
private SqlValidator createSqlValidator(Context context,
CalciteCatalogReader catalogReader) {
final SqlOperatorTable opTab0 =
context.config().fun(SqlOperatorTable.class,
SqlStdOperatorTable.instance());
final SqlOperatorTable opTab =
ChainedSqlOperatorTable.of(opTab0, catalogReader);
final JavaTypeFactory typeFactory = context.getTypeFactory();
final SqlConformance conformance = context.config().conformance();
return new CalciteSqlValidator(opTab, catalogReader, typeFactory,
conformance);
}
开发者ID:apache,项目名称:kylin,代码行数:13,代码来源:CalcitePrepareImpl.java
示例6: createSqlValidator
import org.apache.calcite.sql.validate.SqlConformance; //导入依赖的package包/类
private SqlValidator createSqlValidator(Context context,
CalciteCatalogReader catalogReader) {
final SqlOperatorTable opTab0 =
context.config().fun(SqlOperatorTable.class,
SqlStdOperatorTable.instance());
final SqlOperatorTable opTab =
ChainedSqlOperatorTable.of(opTab0, catalogReader);
final JavaTypeFactory typeFactory = context.getTypeFactory();
final SqlConformance conformance = context.config().conformance();
return new CalciteSqlValidator(opTab, catalogReader, typeFactory,
conformance);
}
开发者ID:apache,项目名称:calcite,代码行数:13,代码来源:CalcitePrepareImpl.java
示例7: conformance
import org.apache.calcite.sql.validate.SqlConformance; //导入依赖的package包/类
private SqlConformance conformance() {
final Context context = config.getContext();
if (context != null) {
final CalciteConnectionConfig connectionConfig =
context.unwrap(CalciteConnectionConfig.class);
if (connectionConfig != null) {
return connectionConfig.conformance();
}
}
return SqlConformanceEnum.DEFAULT;
}
开发者ID:apache,项目名称:calcite,代码行数:12,代码来源:PlannerImpl.java
示例8: expandView
import org.apache.calcite.sql.validate.SqlConformance; //导入依赖的package包/类
@Override public RelRoot expandView(RelDataType rowType, String queryString,
List<String> schemaPath, List<String> viewPath) {
SqlParser parser = SqlParser.create(queryString, parserConfig);
SqlNode sqlNode;
try {
sqlNode = parser.parseQuery();
} catch (SqlParseException e) {
throw new RuntimeException("parse failed", e);
}
final SqlConformance conformance = conformance();
final CalciteCatalogReader catalogReader =
createCatalogReader().withSchemaPath(schemaPath);
final SqlValidator validator =
new CalciteSqlValidator(operatorTable, catalogReader, typeFactory,
conformance);
validator.setIdentifierExpansion(true);
final SqlNode validatedSqlNode = validator.validate(sqlNode);
final RexBuilder rexBuilder = createRexBuilder();
final RelOptCluster cluster = RelOptCluster.create(planner, rexBuilder);
final SqlToRelConverter.Config config = SqlToRelConverter
.configBuilder()
.withConfig(sqlToRelConverterConfig)
.withTrimUnusedFields(false)
.withConvertTableAccess(false)
.build();
final SqlToRelConverter sqlToRelConverter =
new SqlToRelConverter(new ViewExpanderImpl(), validator,
catalogReader, cluster, convertletTable, config);
root = sqlToRelConverter.convertQuery(validatedSqlNode, true, false);
root = root.withRel(sqlToRelConverter.flattenTypes(root.rel, true));
root = root.withRel(RelDecorrelator.decorrelateQuery(root.rel));
return PlannerImpl.this.root;
}
开发者ID:apache,项目名称:calcite,代码行数:38,代码来源:PlannerImpl.java
示例9: ConfigImpl
import org.apache.calcite.sql.validate.SqlConformance; //导入依赖的package包/类
private ConfigImpl(int identifierMaxLength, Casing quotedCasing,
Casing unquotedCasing, Quoting quoting, boolean caseSensitive,
SqlConformance conformance, SqlParserImplFactory parserFactory) {
this.identifierMaxLength = identifierMaxLength;
this.caseSensitive = caseSensitive;
this.conformance = Preconditions.checkNotNull(conformance);
this.quotedCasing = Preconditions.checkNotNull(quotedCasing);
this.unquotedCasing = Preconditions.checkNotNull(unquotedCasing);
this.quoting = Preconditions.checkNotNull(quoting);
this.parserFactory = Preconditions.checkNotNull(parserFactory);
}
开发者ID:apache,项目名称:calcite,代码行数:12,代码来源:SqlParser.java
示例10: getValidator
import org.apache.calcite.sql.validate.SqlConformance; //导入依赖的package包/类
@Override public SqlValidator getValidator(SqlTestFactory factory) {
final RelDataTypeFactory typeFactory =
new SqlTypeFactoryImpl(RelDataTypeSystem.DEFAULT);
final SqlConformance conformance = (SqlConformance) get("conformance");
final boolean caseSensitive = (Boolean) factory.get("caseSensitive");
return new SqlAdvisorValidator(
SqlStdOperatorTable.instance(),
new MockCatalogReader(typeFactory, caseSensitive).init(),
typeFactory,
conformance);
}
开发者ID:apache,项目名称:calcite,代码行数:12,代码来源:SqlAdvisorTest.java
示例11: withConformance
import org.apache.calcite.sql.validate.SqlConformance; //导入依赖的package包/类
public SqlTesterImpl withConformance(SqlConformance conformance) {
if (conformance == null) {
conformance = SqlConformanceEnum.DEFAULT;
}
return with("conformance", conformance)
.withConnectionFactory(
CalciteAssert.EMPTY_CONNECTION_FACTORY
.with("conformance", conformance));
}
开发者ID:apache,项目名称:calcite,代码行数:10,代码来源:SqlTesterImpl.java
示例12: createParser
import org.apache.calcite.sql.validate.SqlConformance; //导入依赖的package包/类
public SqlParser createParser(SqlTestFactory factory, String sql) {
return SqlParser.create(sql,
SqlParser.configBuilder()
.setQuoting((Quoting) factory.get("quoting"))
.setUnquotedCasing((Casing) factory.get("unquotedCasing"))
.setQuotedCasing((Casing) factory.get("quotedCasing"))
.setConformance((SqlConformance) factory.get("conformance"))
.build());
}
开发者ID:apache,项目名称:calcite,代码行数:10,代码来源:DefaultSqlTestFactory.java
示例13: getValidator
import org.apache.calcite.sql.validate.SqlConformance; //导入依赖的package包/类
public SqlValidator getValidator(SqlTestFactory factory) {
final Xyz xyz = cache.getUnchecked(factory);
final SqlConformance conformance =
(SqlConformance) factory.get("conformance");
return SqlValidatorUtil.newValidator(xyz.operatorTable,
xyz.catalogReader, xyz.typeFactory, conformance);
}
开发者ID:apache,项目名称:calcite,代码行数:8,代码来源:DefaultSqlTestFactory.java
示例14: FarragoTestValidator
import org.apache.calcite.sql.validate.SqlConformance; //导入依赖的package包/类
FarragoTestValidator(
SqlOperatorTable opTab,
SqlValidatorCatalogReader catalogReader,
RelDataTypeFactory typeFactory,
SqlConformance conformance) {
super(opTab, catalogReader, typeFactory, conformance);
}
开发者ID:apache,项目名称:calcite,代码行数:8,代码来源:SqlToRelTestBase.java
示例15: getValidator
import org.apache.calcite.sql.validate.SqlConformance; //导入依赖的package包/类
@Override public SqlValidator getValidator(SqlTestFactory factory) {
final RelDataTypeFactory typeFactory =
new SqlTypeFactoryImpl(RelDataTypeSystem.DEFAULT);
SqlConformance conformance = (SqlConformance) get("conformance");
final boolean caseSensitive = (Boolean) get("caseSensitive");
return new FeatureValidator(
factory.createOperatorTable(factory),
new MockCatalogReader(typeFactory, caseSensitive).init(),
typeFactory,
conformance);
}
开发者ID:apache,项目名称:calcite,代码行数:12,代码来源:SqlValidatorFeatureTest.java
示例16: FeatureValidator
import org.apache.calcite.sql.validate.SqlConformance; //导入依赖的package包/类
protected FeatureValidator(
SqlOperatorTable opTab,
SqlValidatorCatalogReader catalogReader,
RelDataTypeFactory typeFactory,
SqlConformance conformance) {
super(opTab, catalogReader, typeFactory, conformance);
}
开发者ID:apache,项目名称:calcite,代码行数:8,代码来源:SqlValidatorFeatureTest.java
示例17: testAbstractConformance
import org.apache.calcite.sql.validate.SqlConformance; //导入依赖的package包/类
@Test public void testAbstractConformance()
throws InvocationTargetException, IllegalAccessException {
final SqlAbstractConformance c0 = new SqlAbstractConformance() {
};
final SqlConformance c1 = SqlConformanceEnum.DEFAULT;
for (Method method : SqlConformance.class.getMethods()) {
final Object o0 = method.invoke(c0);
final Object o1 = method.invoke(c1);
assertThat(method.toString(), Objects.equals(o0, o1), is(true));
}
}
开发者ID:apache,项目名称:calcite,代码行数:12,代码来源:SqlValidatorTest.java
示例18: Sql
import org.apache.calcite.sql.validate.SqlConformance; //导入依赖的package包/类
Sql(String sql, boolean expand, boolean decorrelate, Tester tester,
boolean trim, SqlToRelConverter.Config config,
SqlConformance conformance) {
this.sql = sql;
this.expand = expand;
this.decorrelate = decorrelate;
this.tester = tester;
this.trim = trim;
this.config = config;
this.conformance = conformance;
}
开发者ID:apache,项目名称:calcite,代码行数:12,代码来源:SqlToRelConverterTest.java
示例19: SqlValidatorImpl
import org.apache.calcite.sql.validate.SqlConformance; //导入依赖的package包/类
protected SqlValidatorImpl(FlattenOpCounter flattenCount, SqlOperatorTable opTab, SqlValidatorCatalogReader catalogReader,
RelDataTypeFactory typeFactory, SqlConformance conformance) {
super(opTab, catalogReader, typeFactory, conformance);
this.flattenCount = flattenCount;
}
开发者ID:dremio,项目名称:dremio-oss,代码行数:6,代码来源:SqlValidatorImpl.java
示例20: conformance
import org.apache.calcite.sql.validate.SqlConformance; //导入依赖的package包/类
@Override
public SqlConformance conformance() {
return DremioSqlConformance.INSTANCE;
}
开发者ID:dremio,项目名称:dremio-oss,代码行数:5,代码来源:ParserConfig.java
注:本文中的org.apache.calcite.sql.validate.SqlConformance类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论