jj_consume_token(APPLY); e2 = TableRef2(true); if (!this.conformance.isApplyAllowed()) { {if (true) throw new ParseException(RESOURCE.applyNotAllowed().str());} jj_consume_token(APPLY); e2 = TableRef2(true); if (!this.conformance.isApplyAllowed()) { {if (true) throw new ParseException(RESOURCE.applyNotAllowed().str());}
} else if (jj_2_701(2)) { jj_consume_token(NE2); if (!this.conformance.isBangEqualAllowed()) { {if (true) throw new ParseException(RESOURCE.bangEqualNotAllowed().str());} } else if (jj_2_706(2)) { jj_consume_token(PERCENT_REMAINDER); if (!this.conformance.isPercentRemainderAllowed()) { {if (true) throw new ParseException(RESOURCE.percentRemainderNotAllowed().str());}
} else if (jj_2_677(2)) { jj_consume_token(SET_MINUS); if (!this.conformance.isMinusAllowed()) { {if (true) throw new ParseException(RESOURCE.minusNotAllowed().str());}
} else if (jj_2_276(2)) { jj_consume_token(NE2); if (!this.conformance.isBangEqualAllowed()) { {if (true) throw new ParseException(RESOURCE.bangEqualNotAllowed().str());}
/** * Parses a compound identifier with optional type. */ final public void CompoundIdentifierType(List<SqlNode> list, List<SqlNode> extendList) throws ParseException { final SqlIdentifier name; SqlDataTypeSpec type = null; boolean nullable = true; name = CompoundIdentifier(); if (jj_2_154(2)) { type = DataType(); if (!this.conformance.allowExtend()) { {if (true) throw new ParseException(RESOURCE.extendNotAllowed().str());} } if (jj_2_153(2)) { jj_consume_token(NOT); jj_consume_token(NULL); nullable = false; } else { ; } } else { ; } if (type != null) { extendList.add(name); extendList.add(type.withNullable(nullable)); } list.add(name); }
} else if (jj_2_450(2)) { jj_consume_token(GEOMETRY); if (!this.conformance.allowGeometry()) { {if (true) throw new ParseException(RESOURCE.geometryDisabled().str());}
jj_consume_token(COMMA); count = UnsignedNumericLiteral(); if (!this.conformance.isLimitStartCountAllowed()) { {if (true) throw new ParseException(RESOURCE.limitStartCountNotAllowed().str());}
protected RelDataType getLogicalTargetRowType( RelDataType targetRowType, SqlInsert insert) { if (insert.getTargetColumnList() == null && conformance.isInsertSubsetColumnsAllowed()) { // Target an implicit subset of columns. final SqlNode source = insert.getSource(); final RelDataType sourceRowType = getNamespace(source).getRowType(); final RelDataType logicalSourceRowType = getLogicalSourceRowType(sourceRowType, insert); final RelDataType implicitTargetRowType = typeFactory.createStructType( targetRowType.getFieldList() .subList(0, logicalSourceRowType.getFieldCount())); final SqlValidatorNamespace targetNamespace = getNamespace(insert); validateNamespace(targetNamespace, implicitTargetRowType); return implicitTargetRowType; } else { // Either the set of columns are explicitly targeted, or target the full // set of columns. return targetRowType; } }
public SqlNode visit(SqlIdentifier id) { // Aliases, e.g. 'select a as x, b from t order by x'. if (id.isSimple() && getConformance().isSortByAlias()) { String alias = id.getSimple(); final SqlValidatorNamespace selectNs = getNamespace(select); final RelDataType rowType = selectNs.getRowTypeSansSystemColumns(); final SqlNameMatcher nameMatcher = catalogReader.nameMatcher(); RelDataTypeField field = nameMatcher.field(rowType, alias); if (field != null) { return nthSelectItem( field.getIndex(), id.getParserPosition()); } } // No match. Return identifier unchanged. return getScope().fullyQualify(id).identifier; }
.failsIf(!tester.getConformance().isSortByAlias(), "Expression 'EMPNO' is not in the select clause"); sql("select distinct cast(empno as bigint) as eno " + "from emp order by ^eno^") .failsIf(!tester.getConformance().isSortByAlias(), "Column 'ENO' not found in any table"); sql("select distinct cast(empno as bigint) as empno " + "from emp e order by ^empno^") .failsIf(!tester.getConformance().isSortByAlias(), "Expression 'EMPNO' is not in the select clause"); if (tester.getConformance().isSortByOrdinal()) { check("select distinct cast(empno as bigint) from emp order by 1"); check("select distinct cast(empno as bigint) as empno " "select distinct cast(empno as varchar(10)) as eno from emp " + " order by upper(^eno^)", tester.getConformance().isSortByAlias() ? null : "Column 'ENO' not found in any table");
if (exprContext != ExprContext.ACCEPT_ALL && exprContext != ExprContext.ACCEPT_CURSOR && !this.conformance.allowExplicitRowValueConstructor())
} else if (jj_2_276(2)) { jj_consume_token(NE2); if (!this.conformance.isBangEqualAllowed()) { {if (true) throw new ParseException(RESOURCE.bangEqualNotAllowed().str());}
/** * Parses a compound identifier with optional type. */ final public void CompoundIdentifierType(List<SqlNode> list, List<SqlNode> extendList) throws ParseException { final SqlIdentifier name; SqlDataTypeSpec type = null; boolean nullable = true; name = CompoundIdentifier(); if (jj_2_154(2)) { type = DataType(); if (!this.conformance.allowExtend()) { {if (true) throw new ParseException(RESOURCE.extendNotAllowed().str());} } if (jj_2_153(2)) { jj_consume_token(NOT); jj_consume_token(NULL); nullable = false; } else { ; } } else { ; } if (type != null) { extendList.add(name); extendList.add(type.withNullable(nullable)); } list.add(name); }
} else if (jj_2_450(2)) { jj_consume_token(GEOMETRY); if (!this.conformance.allowGeometry()) { {if (true) throw new ParseException(RESOURCE.geometryDisabled().str());}
jj_consume_token(COMMA); count = UnsignedNumericLiteral(); if (!this.conformance.isLimitStartCountAllowed()) { {if (true) throw new ParseException(RESOURCE.limitStartCountNotAllowed().str());}
if (conformance.isInsertSubsetColumnsAllowed() && targetRowType.isStruct() && rowConstructor.operandCount() < targetRowType.getFieldCount()) { targetRowType =
@Override public boolean isSortByAlias() { return delegate.isSortByAlias(); }
if (exprContext != ExprContext.ACCEPT_ALL && exprContext != ExprContext.ACCEPT_CURSOR && !this.conformance.allowExplicitRowValueConstructor())
} else if (jj_2_701(2)) { jj_consume_token(NE2); if (!this.conformance.isBangEqualAllowed()) { {if (true) throw new ParseException(RESOURCE.bangEqualNotAllowed().str());} } else if (jj_2_706(2)) { jj_consume_token(PERCENT_REMAINDER); if (!this.conformance.isPercentRemainderAllowed()) { {if (true) throw new ParseException(RESOURCE.percentRemainderNotAllowed().str());}
} else if (jj_2_677(2)) { jj_consume_token(SET_MINUS); if (!this.conformance.isMinusAllowed()) { {if (true) throw new ParseException(RESOURCE.minusNotAllowed().str());}