congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
SqlDialect.unparseCall
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: org.apache.calcite/calcite-core

 @Override public void unparseCall(SqlWriter writer, SqlCall call,
   int leftPrec, int rightPrec) {
  if (call instanceof SqlSelect) {
   callsUnparseCallOnSqlSelect[0] = true;
  }
  super.unparseCall(writer, call, leftPrec, rightPrec);
 }
};
origin: Qihoo360/Quicksql

 @Override public void unparseCall(SqlWriter writer, SqlCall call,
   int leftPrec, int rightPrec) {
  if (call instanceof SqlSelect) {
   callsUnparseCallOnSqlSelect[0] = true;
  }
  super.unparseCall(writer, call, leftPrec, rightPrec);
 }
};
origin: org.apache.calcite/calcite-core

@Override public void unparseCall(SqlWriter writer, SqlCall call,
  int leftPrec, int rightPrec) {
 switch (call.getKind()) {
 case FLOOR:
  if (call.operandCount() != 2) {
   super.unparseCall(writer, call, leftPrec, rightPrec);
   return;
  }
  unparseFloor(writer, call);
  break;
 default:
  super.unparseCall(writer, call, leftPrec, rightPrec);
 }
}
origin: Qihoo360/Quicksql

@Override public void unparseCall(SqlWriter writer, SqlCall call,
  int leftPrec, int rightPrec) {
 switch (call.getKind()) {
 case FLOOR:
  if (call.operandCount() != 2) {
   super.unparseCall(writer, call, leftPrec, rightPrec);
   return;
  }
  unparseFloor(writer, call);
  break;
 default:
  super.unparseCall(writer, call, leftPrec, rightPrec);
 }
}
origin: Qihoo360/Quicksql

@Override public void unparse(SqlWriter writer, int leftPrec, int rightPrec) {
 if (!writer.inQuery()) {
  // If this SELECT is the topmost item in a sub-query, introduce a new
  // frame. (The topmost item in the sub-query might be a UNION or
  // ORDER. In this case, we don't need a wrapper frame.)
  final SqlWriter.Frame frame =
    writer.startList(SqlWriter.FrameTypeEnum.SUB_QUERY, "(", ")");
  writer.getDialect().unparseCall(writer, this, 0, 0);
  writer.endList(frame);
 } else {
  writer.getDialect().unparseCall(writer, this, leftPrec, rightPrec);
 }
}
origin: org.apache.calcite/calcite-core

@Override public void unparse(SqlWriter writer, int leftPrec, int rightPrec) {
 if (!writer.inQuery()) {
  // If this SELECT is the topmost item in a sub-query, introduce a new
  // frame. (The topmost item in the sub-query might be a UNION or
  // ORDER. In this case, we don't need a wrapper frame.)
  final SqlWriter.Frame frame =
    writer.startList(SqlWriter.FrameTypeEnum.SUB_QUERY, "(", ")");
  writer.getDialect().unparseCall(writer, this, 0, 0);
  writer.endList(frame);
 } else {
  writer.getDialect().unparseCall(writer, this, leftPrec, rightPrec);
 }
}
origin: org.apache.calcite/calcite-core

@Override public void unparseCall(SqlWriter writer, SqlCall call,
  int leftPrec, int rightPrec) {
 if (call.getOperator() == SqlStdOperatorTable.SUBSTRING) {
  if (call.operandCount() != 3) {
   throw new IllegalArgumentException("MSSQL SUBSTRING requires FROM and FOR arguments");
  }
  SqlUtil.unparseFunctionSyntax(MSSQL_SUBSTRING, writer, call);
 } else {
  switch (call.getKind()) {
  case FLOOR:
   if (call.operandCount() != 2) {
    super.unparseCall(writer, call, leftPrec, rightPrec);
    return;
   }
   unparseFloor(writer, call);
   break;
  default:
   super.unparseCall(writer, call, leftPrec, rightPrec);
  }
 }
}
origin: Qihoo360/Quicksql

@Override public void unparseCall(SqlWriter writer, SqlCall call,
  int leftPrec, int rightPrec) {
 if (call.getOperator() == SqlStdOperatorTable.SUBSTRING) {
  if (call.operandCount() != 3) {
   throw new IllegalArgumentException("MSSQL SUBSTRING requires FROM and FOR arguments");
  }
  SqlUtil.unparseFunctionSyntax(MSSQL_SUBSTRING, writer, call);
 } else {
  switch (call.getKind()) {
  case FLOOR:
   if (call.operandCount() != 2) {
    super.unparseCall(writer, call, leftPrec, rightPrec);
    return;
   }
   unparseFloor(writer, call);
   break;
  default:
   super.unparseCall(writer, call, leftPrec, rightPrec);
  }
 }
}
origin: Qihoo360/Quicksql

public void unparse(
  SqlWriter writer,
  int leftPrec,
  int rightPrec) {
 final SqlOperator operator = getOperator();
 final SqlDialect dialect = writer.getDialect();
 if (leftPrec > operator.getLeftPrec()
   || (operator.getRightPrec() <= rightPrec && (rightPrec != 0))
   || writer.isAlwaysUseParentheses() && isA(SqlKind.EXPRESSION)) {
  final SqlWriter.Frame frame = writer.startList("(", ")");
  dialect.unparseCall(writer, this, 0, 0);
  writer.endList(frame);
 } else {
  dialect.unparseCall(writer, this, leftPrec, rightPrec);
 }
}
origin: org.apache.calcite/calcite-core

public void unparse(
  SqlWriter writer,
  int leftPrec,
  int rightPrec) {
 final SqlOperator operator = getOperator();
 final SqlDialect dialect = writer.getDialect();
 if (leftPrec > operator.getLeftPrec()
   || (operator.getRightPrec() <= rightPrec && (rightPrec != 0))
   || writer.isAlwaysUseParentheses() && isA(SqlKind.EXPRESSION)) {
  final SqlWriter.Frame frame = writer.startList("(", ")");
  dialect.unparseCall(writer, this, 0, 0);
  writer.endList(frame);
 } else {
  dialect.unparseCall(writer, this, leftPrec, rightPrec);
 }
}
origin: Qihoo360/Quicksql

 @Override public void unparseCall(SqlWriter writer, SqlCall call,
   int leftPrec, int rightPrec) {
  switch (call.getKind()) {
  case FLOOR:
   if (call.operandCount() != 2) {
    super.unparseCall(writer, call, leftPrec, rightPrec);
    return;
   }

   final SqlLiteral timeUnitNode = call.operand(1);
   final TimeUnitRange timeUnit = timeUnitNode.getValueAs(TimeUnitRange.class);

   SqlCall call2 = SqlFloorFunction.replaceTimeUnitOperand(call, timeUnit.name(),
     timeUnitNode.getParserPosition());
   SqlFloorFunction.unparseDatetimeFunction(writer, call2, "DATE_TRUNC", false);
   break;

  default:
   super.unparseCall(writer, call, leftPrec, rightPrec);
  }
 }
}
origin: org.apache.calcite/calcite-core

@Override public void unparseCall(SqlWriter writer, SqlCall call,
  int leftPrec, int rightPrec) {
 switch (call.getKind()) {
 case FLOOR:
  if (call.operandCount() != 2) {
   super.unparseCall(writer, call, leftPrec, rightPrec);
   return;
  }
  final SqlLiteral timeUnitNode = call.operand(1);
  final TimeUnitRange timeUnit = timeUnitNode.getValueAs(TimeUnitRange.class);
  final String translatedLit = convertTimeUnit(timeUnit);
  SqlCall call2 = SqlFloorFunction.replaceTimeUnitOperand(call, translatedLit,
    timeUnitNode.getParserPosition());
  SqlFloorFunction.unparseDatetimeFunction(writer, call2, "TRUNC", true);
  break;
 default:
  super.unparseCall(writer, call, leftPrec, rightPrec);
 }
}
origin: org.apache.calcite/calcite-core

 @Override public void unparseCall(SqlWriter writer, SqlCall call,
   int leftPrec, int rightPrec) {
  switch (call.getKind()) {
  case FLOOR:
   if (call.operandCount() != 2) {
    super.unparseCall(writer, call, leftPrec, rightPrec);
    return;
   }

   final SqlLiteral timeUnitNode = call.operand(1);
   final TimeUnitRange timeUnit = timeUnitNode.getValueAs(TimeUnitRange.class);

   SqlCall call2 = SqlFloorFunction.replaceTimeUnitOperand(call, timeUnit.name(),
     timeUnitNode.getParserPosition());
   SqlFloorFunction.unparseDatetimeFunction(writer, call2, "DATE_TRUNC", false);
   break;

  default:
   super.unparseCall(writer, call, leftPrec, rightPrec);
  }
 }
}
origin: Qihoo360/Quicksql

@Override public void unparseCall(SqlWriter writer, SqlCall call,
  int leftPrec, int rightPrec) {
 switch (call.getKind()) {
 case FLOOR:
  if (call.operandCount() != 2) {
   super.unparseCall(writer, call, leftPrec, rightPrec);
   return;
  }
  final SqlLiteral timeUnitNode = call.operand(1);
  final TimeUnitRange timeUnit = timeUnitNode.getValueAs(TimeUnitRange.class);
  final String translatedLit = convertTimeUnit(timeUnit);
  SqlCall call2 = SqlFloorFunction.replaceTimeUnitOperand(call, translatedLit,
    timeUnitNode.getParserPosition());
  SqlFloorFunction.unparseDatetimeFunction(writer, call2, "TRUNC", true);
  break;
 default:
  super.unparseCall(writer, call, leftPrec, rightPrec);
 }
}
origin: org.apache.calcite/calcite-core

 @Override public void unparseCall(SqlWriter writer, SqlCall call,
   int leftPrec, int rightPrec) {
  if (call.getOperator() == SqlStdOperatorTable.SUBSTRING) {
   SqlUtil.unparseFunctionSyntax(OracleSqlOperatorTable.SUBSTR, writer, call);
  } else {
   switch (call.getKind()) {
   case FLOOR:
    if (call.operandCount() != 2) {
     super.unparseCall(writer, call, leftPrec, rightPrec);
     return;
    }

    final SqlLiteral timeUnitNode = call.operand(1);
    final TimeUnitRange timeUnit = timeUnitNode.getValueAs(TimeUnitRange.class);

    SqlCall call2 = SqlFloorFunction.replaceTimeUnitOperand(call, timeUnit.name(),
      timeUnitNode.getParserPosition());
    SqlFloorFunction.unparseDatetimeFunction(writer, call2, "TRUNC", true);
    break;

   default:
    super.unparseCall(writer, call, leftPrec, rightPrec);
   }
  }
 }
}
origin: Qihoo360/Quicksql

 @Override public void unparseCall(SqlWriter writer, SqlCall call,
   int leftPrec, int rightPrec) {
  if (call.getOperator() == SqlStdOperatorTable.SUBSTRING) {
   SqlUtil.unparseFunctionSyntax(OracleSqlOperatorTable.SUBSTR, writer, call);
  } else {
   switch (call.getKind()) {
   case FLOOR:
    if (call.operandCount() != 2) {
     super.unparseCall(writer, call, leftPrec, rightPrec);
     return;
    }

    final SqlLiteral timeUnitNode = call.operand(1);
    final TimeUnitRange timeUnit = timeUnitNode.getValueAs(TimeUnitRange.class);

    SqlCall call2 = SqlFloorFunction.replaceTimeUnitOperand(call, timeUnit.name(),
      timeUnitNode.getParserPosition());
    SqlFloorFunction.unparseDatetimeFunction(writer, call2, "TRUNC", true);
    break;

   default:
    super.unparseCall(writer, call, leftPrec, rightPrec);
   }
  }
 }
}
org.apache.calcite.sqlSqlDialectunparseCall

Popular methods of SqlDialect

  • quoteStringLiteral
    Converts a string into a string literal. For example, can't run becomes 'can''t run'.
  • <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
  • 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

  • Creating JSON documents from java classes using gson
  • requestLocationUpdates (LocationManager)
  • setRequestProperty (URLConnection)
  • getSharedPreferences (Context)
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • Top 15 Vim Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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