Java Code Examples for org.apache.calcite.sql.type.SqlTypeName#name()

The following examples show how to use org.apache.calcite.sql.type.SqlTypeName#name() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RelDataTypeImpl.java    From Bats with Apache License 2.0 5 votes vote down vote up
public SqlIdentifier getSqlIdentifier() {
  SqlTypeName typeName = getSqlTypeName();
  if (typeName == null) {
    return null;
  }
  return new SqlIdentifier(
      typeName.name(),
      SqlParserPos.ZERO);
}
 
Example 2
Source File: RelDataTypeImpl.java    From calcite with Apache License 2.0 5 votes vote down vote up
public SqlIdentifier getSqlIdentifier() {
  SqlTypeName typeName = getSqlTypeName();
  if (typeName == null) {
    return null;
  }
  return new SqlIdentifier(
      typeName.name(),
      SqlParserPos.ZERO);
}
 
Example 3
Source File: SqlCollectionTypeNameSpec.java    From calcite with Apache License 2.0 5 votes vote down vote up
/**
 * Creates a {@code SqlCollectionTypeNameSpec}.
 *
 * @param elementTypeName    Type of the collection element
 * @param collectionTypeName Collection type name
 * @param pos                Parser position, must not be null
 */
public SqlCollectionTypeNameSpec(SqlTypeNameSpec elementTypeName,
    SqlTypeName collectionTypeName,
    SqlParserPos pos) {
  super(new SqlIdentifier(collectionTypeName.name(), pos), pos);
  this.elementTypeName = Objects.requireNonNull(elementTypeName);
  this.collectionTypeName = Objects.requireNonNull(collectionTypeName);
}
 
Example 4
Source File: SqlBasicTypeNameSpec.java    From calcite with Apache License 2.0 5 votes vote down vote up
/**
 * Create a basic sql type name specification.
 *
 * @param typeName    Type name
 * @param precision   Precision of the type name if it is allowed, default is -1
 * @param scale       Scale of the type name if it is allowed, default is -1
 * @param charSetName Char set of the type, only works when the type
 *                    belong to CHARACTER type family
 * @param pos         The parser position
 */
public SqlBasicTypeNameSpec(
    SqlTypeName typeName,
    int precision,
    int scale,
    @Nullable String charSetName,
    SqlParserPos pos) {
  super(new SqlIdentifier(typeName.name(), pos), pos);
  this.sqlTypeName = typeName;
  this.precision = precision;
  this.scale = scale;
  this.charSetName = charSetName;
}