Java Code Examples for org.apache.calcite.sql.SqlDataTypeSpec#getTypeName()
The following examples show how to use
org.apache.calcite.sql.SqlDataTypeSpec#getTypeName() .
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: ExpressionComparator.java From kylin-on-parquet-v2 with Apache License 2.0 | 6 votes |
protected boolean isSqlDataTypeSpecEqual(SqlDataTypeSpec querySqlDataTypeSpec, SqlDataTypeSpec exprSqlDataTypeSpec) { if (querySqlDataTypeSpec.getTypeName() == null || CollectionUtils.isEmpty(querySqlDataTypeSpec.getTypeName().names)) return false; if (querySqlDataTypeSpec.getTypeName().names.size() != exprSqlDataTypeSpec.getTypeName().names.size()) return false; for (int i = 0; i < querySqlDataTypeSpec.getTypeName().names.size(); i++) { String queryName = querySqlDataTypeSpec.getTypeName().names.get(i); if (!exprSqlDataTypeSpec.getTypeName().names.contains(queryName)) { return false; } } return querySqlDataTypeSpec.getScale() == exprSqlDataTypeSpec.getScale() && querySqlDataTypeSpec.getPrecision() == exprSqlDataTypeSpec.getPrecision(); }
Example 2
Source File: ExpressionComparator.java From kylin with Apache License 2.0 | 6 votes |
protected boolean isSqlDataTypeSpecEqual(SqlDataTypeSpec querySqlDataTypeSpec, SqlDataTypeSpec exprSqlDataTypeSpec) { if (querySqlDataTypeSpec.getTypeName() == null || CollectionUtils.isEmpty(querySqlDataTypeSpec.getTypeName().names)) return false; if (querySqlDataTypeSpec.getTypeName().names.size() != exprSqlDataTypeSpec.getTypeName().names.size()) return false; for (int i = 0; i < querySqlDataTypeSpec.getTypeName().names.size(); i++) { String queryName = querySqlDataTypeSpec.getTypeName().names.get(i); if (!exprSqlDataTypeSpec.getTypeName().names.contains(queryName)) { return false; } } return querySqlDataTypeSpec.getScale() == exprSqlDataTypeSpec.getScale() && querySqlDataTypeSpec.getPrecision() == exprSqlDataTypeSpec.getPrecision(); }
Example 3
Source File: ExtendedSqlType.java From flink with Apache License 2.0 | 5 votes |
static void unparseType(SqlDataTypeSpec type, SqlWriter writer, int leftPrec, int rightPrec) { if (type.getTypeName() instanceof ExtendedSqlType) { type.getTypeName().unparse(writer, leftPrec, rightPrec); } else { type.unparse(writer, leftPrec, rightPrec); } }