Java Code Examples for org.apache.calcite.sql2rel.SqlRexConvertlet

The following examples show how to use org.apache.calcite.sql2rel.SqlRexConvertlet. These examples are extracted from open source projects. 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 Project: Bats   Source File: DrillConvertletTable.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public SqlRexConvertlet get(SqlCall call) {
  SqlRexConvertlet convertlet;
  if(call.getOperator() instanceof DrillCalciteSqlWrapper) {
    final SqlOperator wrapper = call.getOperator();
    final SqlOperator wrapped = DrillCalciteWrapperUtility.extractSqlOperatorFromWrapper(call.getOperator());
    if ((convertlet = map.get(wrapped)) != null) {
      return convertlet;
    }

    ((SqlBasicCall) call).setOperator(wrapped);
    SqlRexConvertlet sqlRexConvertlet = StandardConvertletTable.INSTANCE.get(call);
    ((SqlBasicCall) call).setOperator(wrapper);
    return sqlRexConvertlet;
  }

  if ((convertlet = map.get(call.getOperator())) != null) {
    return convertlet;
  }

  return StandardConvertletTable.INSTANCE.get(call);
}
 
Example 2
Source Project: dremio-oss   Source File: ConvertletTable.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public SqlRexConvertlet get(SqlCall call) {
  SqlRexConvertlet convertlet;

  if ((convertlet = super.get(call)) != null) {
    return convertlet;
  }

  return StandardConvertletTable.INSTANCE.get(call);
}
 
Example 3
@Override
public SqlRexConvertlet get(SqlCall call) {
  SqlOperator operator = call.getOperator();
  if(operator.isDynamicFunction() && !WHITELIST.contains(operator)) {
    contextSensitive = true;
  }
  return delegate.get(call);
}