congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
SqlDialect.hasImplicitTableAlias
Code IndexAdd Tabnine to your IDE (free)

How to use
hasImplicitTableAlias
method
in
org.apache.calcite.sql.SqlDialect

Best Java code snippets using org.apache.calcite.sql.SqlDialect.hasImplicitTableAlias (Showing top 6 results out of 315)

origin: Qihoo360/Quicksql

/** Converts a non-query node into a SELECT node. Set operators (UNION,
 * INTERSECT, EXCEPT) remain as is. */
public SqlSelect asSelect() {
 if (node instanceof SqlSelect) {
  return (SqlSelect) node;
 }
 if (!dialect.hasImplicitTableAlias()) {
  return wrapSelect(asFrom());
 }
 return wrapSelect(node);
}
origin: org.apache.calcite/calcite-core

/** Converts a non-query node into a SELECT node. Set operators (UNION,
 * INTERSECT, EXCEPT) remain as is. */
public SqlSelect asSelect() {
 if (node instanceof SqlSelect) {
  return (SqlSelect) node;
 }
 if (!dialect.hasImplicitTableAlias()) {
  return wrapSelect(asFrom());
 }
 return wrapSelect(node);
}
origin: Qihoo360/Quicksql

/** Creates a result based on a single relational expression. */
public Result result(SqlNode node, Collection<Clause> clauses,
  RelNode rel, Map<String, RelDataType> aliases) {
 assert aliases == null
   || aliases.size() < 2
   || aliases instanceof LinkedHashMap
   || aliases instanceof ImmutableMap
   : "must use a Map implementation that preserves order";
 final String alias2 = SqlValidatorUtil.getAlias(node, -1);
 final String alias3 = alias2 != null ? alias2 : "t";
 final String alias4 =
   SqlValidatorUtil.uniquify(
     alias3, aliasSet, SqlValidatorUtil.EXPR_SUGGESTER);
 if (aliases != null
   && !aliases.isEmpty()
   && (!dialect.hasImplicitTableAlias()
    || aliases.size() > 1)) {
  return new Result(node, clauses, alias4, rel.getRowType(), aliases);
 }
 final String alias5;
 if (alias2 == null
   || !alias2.equals(alias4)
   || !dialect.hasImplicitTableAlias()) {
  alias5 = alias4;
 } else {
  alias5 = null;
 }
 return new Result(node, clauses, alias5, rel.getRowType(),
   ImmutableMap.of(alias4, rel.getRowType()));
}
origin: org.apache.calcite/calcite-core

/** Creates a result based on a single relational expression. */
public Result result(SqlNode node, Collection<Clause> clauses,
  RelNode rel, Map<String, RelDataType> aliases) {
 assert aliases == null
   || aliases.size() < 2
   || aliases instanceof LinkedHashMap
   || aliases instanceof ImmutableMap
   : "must use a Map implementation that preserves order";
 final String alias2 = SqlValidatorUtil.getAlias(node, -1);
 final String alias3 = alias2 != null ? alias2 : "t";
 final String alias4 =
   SqlValidatorUtil.uniquify(
     alias3, aliasSet, SqlValidatorUtil.EXPR_SUGGESTER);
 if (aliases != null
   && !aliases.isEmpty()
   && (!dialect.hasImplicitTableAlias()
    || aliases.size() > 1)) {
  return new Result(node, clauses, alias4, rel.getRowType(), aliases);
 }
 final String alias5;
 if (alias2 == null
   || !alias2.equals(alias4)
   || !dialect.hasImplicitTableAlias()) {
  alias5 = alias4;
 } else {
  alias5 = null;
 }
 return new Result(node, clauses, alias5, rel.getRowType(),
   ImmutableMap.of(alias4, rel.getRowType()));
}
origin: org.apache.calcite/calcite-core

} else {
 boolean qualified =
   !dialect.hasImplicitTableAlias() || aliases.size() > 1;
origin: Qihoo360/Quicksql

} else {
 boolean qualified =
   !dialect.hasImplicitTableAlias() || aliases.size() > 1;
org.apache.calcite.sqlSqlDialecthasImplicitTableAlias

Javadoc

Returns whether a qualified table in the FROM clause has an implicit alias which consists of just the table name.

For example, in DatabaseProduct#ORACLE

SELECT * FROM sales.emp

is equivalent to

SELECT * FROM sales.emp AS emp

and therefore

SELECT emp.empno FROM sales.emp

is valid. But DatabaseProduct#DB2 does not have an implicit alias, so the previous query it not valid; you need to write

SELECT sales.emp.empno FROM sales.emp

Returns true for all databases except DB2.

Popular methods of SqlDialect

  • quoteStringLiteral
    Converts a string into a string literal. For example, can't run becomes 'can''t run'.
  • unparseCall
  • <init>
    Creates a SqlDialect.
  • quoteIdentifier
    Quotes a multi-part identifier.
  • supportsAggregateFunction
  • supportsCharSet
    Returns whether the dialect supports character set names as part of a data type, for instance VARCHA
  • allowsAs
  • containsNonAscii
    Returns whether the string contains any characters outside the comfortable 7-bit ASCII range (32 thr
  • defaultNullDirection
    Returns whether NULL values are sorted first or last, in this dialect, in an ORDER BY item of a give
  • emulateNullDirection
    Returns the SqlNode for emulating the null direction for the given field or null if no emulation ne
  • getCalendarPolicy
  • getCastSpec
  • getCalendarPolicy,
  • getCastSpec,
  • getDatabaseProduct,
  • getNullCollation,
  • identifierNeedsToBeQuoted,
  • quoteStringLiteralUnicode,
  • quoteTimestampLiteral,
  • rewriteSingleValueExpr,
  • supportsAliasedValues

Popular in Java

  • Updating database using SQL prepared statement
  • getExternalFilesDir (Context)
  • findViewById (Activity)
  • onCreateOptionsMenu (Activity)
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.> This module, both source code and documentation, is in t
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now