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

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

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

origin: Qihoo360/Quicksql

public SqlNode getCastSpec(RelDataType type) {
 if (type instanceof BasicSqlType) {
  return new SqlDataTypeSpec(
    new SqlIdentifier(type.getSqlTypeName().name(), SqlParserPos.ZERO),
      type.getPrecision(),
      type.getScale(),
      type.getCharset() != null
        && supportsCharSet()
        ? type.getCharset().name()
        : null,
      null,
      SqlParserPos.ZERO);
 }
 return SqlTypeUtil.convertTypeToSpec(type);
}
origin: org.apache.calcite/calcite-core

public SqlNode getCastSpec(RelDataType type) {
 if (type instanceof BasicSqlType) {
  int precision = type.getPrecision();
  switch (type.getSqlTypeName()) {
  case VARCHAR:
   // if needed, adjust varchar length to max length supported by the system
   int maxPrecision = getTypeSystem().getMaxPrecision(type.getSqlTypeName());
   if (type.getPrecision() > maxPrecision) {
    precision = maxPrecision;
   }
  }
  return new SqlDataTypeSpec(
    new SqlIdentifier(type.getSqlTypeName().name(), SqlParserPos.ZERO),
      precision,
      type.getScale(),
      type.getCharset() != null
        && supportsCharSet()
        ? type.getCharset().name()
        : null,
      null,
      SqlParserPos.ZERO);
 }
 return SqlTypeUtil.convertTypeToSpec(type);
}
origin: qubole/quark

private SqlNode toSql(RelDataType type) {
 switch (dialect.getDatabaseProduct()) {
  case MYSQL:
   switch (type.getSqlTypeName()) {
    case VARCHAR:
     // MySQL doesn't have a VARCHAR type, only CHAR.
     return new SqlDataTypeSpec(new SqlIdentifier("CHAR", POS),
       type.getPrecision(), -1, null, null, POS);
    case INTEGER:
     return new SqlDataTypeSpec(new SqlIdentifier("_UNSIGNED", POS),
       type.getPrecision(), -1, null, null, POS);
   }
   break;
 }
 if (type instanceof BasicSqlType) {
  return new SqlDataTypeSpec(
    new SqlIdentifier(type.getSqlTypeName().name(), POS),
    type.getPrecision(),
    type.getScale(),
    type.getCharset() != null
      && dialect.supportsCharSet()
      ? type.getCharset().name()
      : null,
    null,
    POS);
 }
 return SqlTypeUtil.convertTypeToSpec(type);
 //throw new AssertionError(type); // TODO: implement
}
org.apache.calcite.sqlSqlDialectsupportsCharSet

Javadoc

Returns whether the dialect supports character set names as part of a data type, for instance VARCHAR(30) CHARACTER SET `ISO-8859-1`.

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

Popular in Java

  • Running tasks concurrently on multiple threads
  • startActivity (Activity)
  • notifyDataSetChanged (ArrayAdapter)
  • onCreateOptionsMenu (Activity)
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • Collectors (java.util.stream)
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • Runner (org.openjdk.jmh.runner)
  • Best plugins for Eclipse
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