use of org.apache.calcite.sql.SqlLiteral in project drill by apache.
the class MetastoreAnalyzeTableHandler method getMetadataType.
private MetadataType getMetadataType(SqlMetastoreAnalyzeTable sqlAnalyzeTable) {
SqlLiteral stringLiteral = sqlAnalyzeTable.getLevel();
// for the case when metadata level is not specified in ANALYZE statement,
// value from the `metastore.metadata.store.depth_level` option is used
String metadataLevel;
if (stringLiteral == null) {
metadataLevel = context.getOption(ExecConstants.METASTORE_METADATA_STORE_DEPTH_LEVEL).string_val;
} else {
metadataLevel = stringLiteral.toValue();
}
return metadataLevel != null ? MetadataType.valueOf(metadataLevel.toUpperCase()) : MetadataType.ALL;
}
use of org.apache.calcite.sql.SqlLiteral in project hive by apache.
the class HiveJdbcImplementor method visit.
@Override
public Result visit(Join e) {
final Result leftResult = visitInput(e, 0).resetAlias();
final Result rightResult = visitInput(e, 1).resetAlias();
final Context leftContext = leftResult.qualifiedContext();
final Context rightContext = rightResult.qualifiedContext();
SqlNode sqlCondition = null;
SqlLiteral condType = JoinConditionType.ON.symbol(POS);
JoinType joinType = joinType(e.getJoinType());
if (e.getJoinType() == JoinRelType.INNER && e.getCondition().isAlwaysTrue()) {
joinType = JoinType.COMMA;
condType = JoinConditionType.NONE.symbol(POS);
} else {
sqlCondition = convertConditionToSqlNode(e.getCondition(), leftContext, rightContext, e.getLeft().getRowType().getFieldCount());
}
SqlNode join = new SqlJoin(POS, leftResult.asFrom(), SqlLiteral.createBoolean(false, POS), joinType.symbol(POS), rightResult.asFrom(), condType, sqlCondition);
return result(join, leftResult, rightResult);
}
Aggregations