Codota Logo
SqlValidatorImpl$OrderExpressionExpander.getScope
Code IndexAdd Codota to your IDE (free)

How to use
getScope
method
in
org.apache.calcite.sql.validate.SqlValidatorImpl$OrderExpressionExpander

Best Java code snippets using org.apache.calcite.sql.validate.SqlValidatorImpl$OrderExpressionExpander.getScope (Showing top 6 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Dictionary d =
  • Codota Iconnew Hashtable()
  • Codota IconBundle bundle;bundle.getHeaders()
  • Codota Iconnew Properties()
  • Smart code suggestions by Codota
}
origin: apache/flink

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;
}
origin: apache/flink

/**
 * Returns the <code>ordinal</code>th item in the select list.
 */
private SqlNode nthSelectItem(int ordinal, final SqlParserPos pos) {
  // TODO: Don't expand the list every time. Maybe keep an expanded
  // version of each expression -- select lists and identifiers -- in
  // the validator.
  SqlNodeList expandedSelectList =
    expandStar(
      select.getSelectList(),
      select,
      false);
  SqlNode expr = expandedSelectList.get(ordinal);
  expr = stripAs(expr);
  if (expr instanceof SqlIdentifier) {
    expr = getScope().fullyQualify((SqlIdentifier) expr).identifier;
  }
  // Create a copy of the expression with the position of the order
  // item.
  return expr.clone(pos);
}
origin: Qihoo360/Quicksql

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;
}
origin: org.apache.calcite/calcite-core

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;
}
origin: Qihoo360/Quicksql

/**
 * Returns the <code>ordinal</code>th item in the select list.
 */
private SqlNode nthSelectItem(int ordinal, final SqlParserPos pos) {
 // TODO: Don't expand the list every time. Maybe keep an expanded
 // version of each expression -- select lists and identifiers -- in
 // the validator.
 SqlNodeList expandedSelectList =
   expandStar(
     select.getSelectList(),
     select,
     false);
 SqlNode expr = expandedSelectList.get(ordinal);
 expr = stripAs(expr);
 if (expr instanceof SqlIdentifier) {
  expr = getScope().fullyQualify((SqlIdentifier) expr).identifier;
 }
 // Create a copy of the expression with the position of the order
 // item.
 return expr.clone(pos);
}
origin: org.apache.calcite/calcite-core

/**
 * Returns the <code>ordinal</code>th item in the select list.
 */
private SqlNode nthSelectItem(int ordinal, final SqlParserPos pos) {
 // TODO: Don't expand the list every time. Maybe keep an expanded
 // version of each expression -- select lists and identifiers -- in
 // the validator.
 SqlNodeList expandedSelectList =
   expandStar(
     select.getSelectList(),
     select,
     false);
 SqlNode expr = expandedSelectList.get(ordinal);
 expr = stripAs(expr);
 if (expr instanceof SqlIdentifier) {
  expr = getScope().fullyQualify((SqlIdentifier) expr).identifier;
 }
 // Create a copy of the expression with the position of the order
 // item.
 return expr.clone(pos);
}
org.apache.calcite.sql.validateSqlValidatorImpl$OrderExpressionExpandergetScope

Popular methods of SqlValidatorImpl$OrderExpressionExpander

  • <init>
  • go
  • nthSelectItem
    Returns the ordinalth item in the select list.

Popular in Java

  • Creating JSON documents from java classes using gson
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • startActivity (Activity)
  • findViewById (Activity)
  • Color (java.awt)
    The Color class is used encapsulate colors in the default sRGB color space or colors in arbitrary co
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • Hashtable (java.util)
    Hashtable is a synchronized implementation of Map. All optional operations are supported.Neither key
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • JCheckBox (javax.swing)
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now