@Override public SqlValidatorNamespace resolve() { assert resolvedNamespace != null : "must call validate first"; return resolvedNamespace.resolve(); }
@Override public SqlValidatorNamespace resolve() { assert resolvedNamespace != null : "must call validate first"; return resolvedNamespace.resolve(); }
protected RelOptTable getTargetTable(SqlNode call) { SqlValidatorNamespace targetNs = validator.getNamespace(call).resolve(); return SqlValidatorUtil.getRelOptTable(targetNs, catalogReader, null, null); }
protected RelOptTable getTargetTable(SqlNode call) { final SqlValidatorNamespace targetNs = validator.getNamespace(call); if (targetNs.isWrapperFor(SqlValidatorImpl.DmlNamespace.class)) { final SqlValidatorImpl.DmlNamespace dmlNamespace = targetNs.unwrap(SqlValidatorImpl.DmlNamespace.class); return SqlValidatorUtil.getRelOptTable(dmlNamespace, catalogReader, null, null); } final SqlValidatorNamespace resolvedNamespace = targetNs.resolve(); return SqlValidatorUtil.getRelOptTable(resolvedNamespace, catalogReader, null, null); }
protected RelOptTable getTargetTable(SqlNode call) { final SqlValidatorNamespace targetNs = validator.getNamespace(call); if (targetNs.isWrapperFor(SqlValidatorImpl.DmlNamespace.class)) { final SqlValidatorImpl.DmlNamespace dmlNamespace = targetNs.unwrap(SqlValidatorImpl.DmlNamespace.class); return SqlValidatorUtil.getRelOptTable(dmlNamespace, catalogReader, null, null); } final SqlValidatorNamespace resolvedNamespace = targetNs.resolve(); return SqlValidatorUtil.getRelOptTable(resolvedNamespace, catalogReader, null, null); }
protected RelOptTable getTargetTable(SqlNode call) { final SqlValidatorNamespace targetNs = validator.getNamespace(call); if (targetNs.isWrapperFor(SqlValidatorImpl.DmlNamespace.class)) { final SqlValidatorImpl.DmlNamespace dmlNamespace = targetNs.unwrap(SqlValidatorImpl.DmlNamespace.class); return SqlValidatorUtil.getRelOptTable(dmlNamespace, catalogReader, null, null); } final SqlValidatorNamespace resolvedNamespace = targetNs.resolve(); return SqlValidatorUtil.getRelOptTable(resolvedNamespace, catalogReader, null, null); }
/** * Returns whether there are any input columns that are sorted. * * <p>If so, it can be the default ORDER BY clause for a WINDOW specification. * (This is an extension to the SQL standard for streaming.) */ public static boolean containsMonotonic(SqlValidatorScope scope) { for (SqlValidatorNamespace ns : children(scope)) { ns = ns.resolve(); for (String field : ns.getRowType().getFieldNames()) { if (!ns.getMonotonicity(field).mayRepeat()) { return true; } } } return false; }
/** * Returns whether there are any input columns that are sorted. * * <p>If so, it can be the default ORDER BY clause for a WINDOW specification. * (This is an extension to the SQL standard for streaming.) */ public static boolean containsMonotonic(SqlValidatorScope scope) { for (SqlValidatorNamespace ns : children(scope)) { ns = ns.resolve(); for (String field : ns.getRowType().getFieldNames()) { if (!ns.getMonotonicity(field).mayRepeat()) { return true; } } } return false; }
public SqlMonotonicity getMonotonicity(SqlValidatorScope scope) { // for "star" column, whether it's static or dynamic return not_monotonic directly. if (Util.last(names).equals("") || DynamicRecordType.isDynamicStarColName(Util.last(names))) { return SqlMonotonicity.NOT_MONOTONIC; } // First check for builtin functions which don't have parentheses, // like "LOCALTIME". final SqlValidator validator = scope.getValidator(); SqlCall call = SqlUtil.makeCall( validator.getOperatorTable(), this); if (call != null) { return call.getMonotonicity(scope); } final SqlQualified qualified = scope.fullyQualify(this); final SqlIdentifier fqId = qualified.identifier; return qualified.namespace.resolve().getMonotonicity(Util.last(fqId.names)); } }
public SqlMonotonicity getMonotonicity(SqlValidatorScope scope) { // for "star" column, whether it's static or dynamic return not_monotonic directly. if (Util.last(names).equals("") || DynamicRecordType.isDynamicStarColName(Util.last(names))) { return SqlMonotonicity.NOT_MONOTONIC; } // First check for builtin functions which don't have parentheses, // like "LOCALTIME". final SqlValidator validator = scope.getValidator(); SqlCall call = SqlUtil.makeCall( validator.getOperatorTable(), this); if (call != null) { return call.getMonotonicity(scope); } final SqlQualified qualified = scope.fullyQualify(this); final SqlIdentifier fqId = qualified.identifier; return qualified.namespace.resolve().getMonotonicity(Util.last(fqId.names)); } }
private void convertIdentifier(Blackboard bb, SqlIdentifier id, SqlNodeList extendedColumns) { final SqlValidatorNamespace fromNamespace = validator.getNamespace(id).resolve(); if (fromNamespace.getNode() != null) { convertFrom(bb, fromNamespace.getNode());
private void convertIdentifier(Blackboard bb, SqlIdentifier id, SqlNodeList extendedColumns) { final SqlValidatorNamespace fromNamespace = validator.getNamespace(id).resolve(); if (fromNamespace.getNode() != null) { convertFrom(bb, fromNamespace.getNode());
private void convertIdentifier(Blackboard bb, SqlIdentifier id, SqlNodeList extendedColumns) { final SqlValidatorNamespace fromNamespace = validator.getNamespace(id).resolve(); if (fromNamespace.getNode() != null) { convertFrom(bb, fromNamespace.getNode());
private void convertIdentifier(Blackboard bb, SqlIdentifier id, SqlNodeList extendedColumns) { final SqlValidatorNamespace fromNamespace = validator.getNamespace(id).resolve(); if (fromNamespace.getNode() != null) { convertFrom(bb, fromNamespace.getNode());