Tabnine Logo
SqlDialect.getCastSpec
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: org.apache.calcite/calcite-core

@Override public SqlNode getCastSpec(RelDataType type) {
 String castSpec;
 switch (type.getSqlTypeName()) {
 case TINYINT:
  // Postgres has no tinyint (1 byte), so instead cast to smallint (2 bytes)
  castSpec = "_smallint";
  break;
 case DOUBLE:
  // Postgres has a double type but it is named differently
  castSpec = "_double precision";
  break;
 default:
  return super.getCastSpec(type);
 }
 return new SqlDataTypeSpec(new SqlIdentifier(castSpec, SqlParserPos.ZERO),
   -1, -1, null, null, SqlParserPos.ZERO);
}
origin: Qihoo360/Quicksql

@Override public SqlNode getCastSpec(RelDataType type) {
 String castSpec;
 switch (type.getSqlTypeName()) {
 case TINYINT:
  // Postgres has no tinyint (1 byte), so instead cast to smallint (2 bytes)
  castSpec = "_smallint";
  break;
 case DOUBLE:
  // Postgres has a double type but it is named differently
  castSpec = "_double precision";
  break;
 default:
  return super.getCastSpec(type);
 }
 return new SqlDataTypeSpec(new SqlIdentifier(castSpec, SqlParserPos.ZERO),
   -1, -1, null, null, SqlParserPos.ZERO);
}
origin: Qihoo360/Quicksql

@Override public SqlNode getCastSpec(RelDataType type) {
 switch (type.getSqlTypeName()) {
 case VARCHAR:
  // MySQL doesn't have a VARCHAR type, only CHAR.
  return new SqlDataTypeSpec(new SqlIdentifier("CHAR", SqlParserPos.ZERO),
    type.getPrecision(), -1, null, null, SqlParserPos.ZERO);
 case INTEGER:
  return new SqlDataTypeSpec(new SqlIdentifier("_UNSIGNED", SqlParserPos.ZERO),
    type.getPrecision(), -1, null, null, SqlParserPos.ZERO);
 }
 return super.getCastSpec(type);
}
origin: org.apache.calcite/calcite-core

@Override public SqlNode getCastSpec(RelDataType type) {
 switch (type.getSqlTypeName()) {
 case VARCHAR:
  // MySQL doesn't have a VARCHAR type, only CHAR.
  return new SqlDataTypeSpec(new SqlIdentifier("CHAR", SqlParserPos.ZERO),
    type.getPrecision(), -1, null, null, SqlParserPos.ZERO);
 case INTEGER:
 case BIGINT:
  return new SqlDataTypeSpec(new SqlIdentifier("_SIGNED", SqlParserPos.ZERO),
    type.getPrecision(), -1, null, null, SqlParserPos.ZERO);
 }
 return super.getCastSpec(type);
}
origin: Qihoo360/Quicksql

 return nodeList.get(0);
} else {
 nodeList.add(dialect.getCastSpec(call.getType()));
origin: org.apache.calcite/calcite-core

 return nodeList.get(0);
} else {
 nodeList.add(dialect.getCastSpec(call.getType()));
org.apache.calcite.sqlSqlDialectgetCastSpec

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
  • getDatabaseProduct
    Returns the database this dialect belongs to, SqlDialect.DatabaseProduct#UNKNOWN if not known, never
  • getCalendarPolicy,
  • getDatabaseProduct,
  • getNullCollation,
  • hasImplicitTableAlias,
  • identifierNeedsToBeQuoted,
  • quoteStringLiteralUnicode,
  • quoteTimestampLiteral,
  • rewriteSingleValueExpr,
  • supportsAliasedValues

Popular in Java

  • Reactive rest calls using spring rest template
  • getSharedPreferences (Context)
  • setContentView (Activity)
  • putExtra (Intent)
  • BufferedInputStream (java.io)
    A BufferedInputStream adds functionality to another input stream-namely, the ability to buffer the i
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • Top plugins for Android Studio
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