Class DruidUserDefinedTableMacroConversion
java.lang.Object
org.apache.druid.sql.calcite.external.DruidUserDefinedTableMacroConversion
- All Implemented Interfaces:
SqlOperatorConversion
- Direct Known Subclasses:
HttpOperatorConversion,InlineOperatorConversion,LocalOperatorConversion
public abstract class DruidUserDefinedTableMacroConversion
extends Object
implements SqlOperatorConversion
Operator conversion for user-defined table macros (functions) based on the
TableFunction abstraction defined by the catalog.-
Constructor Summary
ConstructorsConstructorDescriptionDruidUserDefinedTableMacroConversion(String name, TableFunction fn, com.fasterxml.jackson.databind.ObjectMapper jsonMapper) DruidUserDefinedTableMacroConversion(String name, TableDefnRegistry registry, String tableType, com.fasterxml.jackson.databind.ObjectMapper jsonMapper) -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.calcite.sql.SqlOperatorReturns the SQL operator corresponding to this function.toDruidExpression(PlannerContext plannerContext, RowSignature rowSignature, org.apache.calcite.rex.RexNode rexNode) Translate a CalciteRexNodeto a Druid expression.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.druid.sql.calcite.expression.SqlOperatorConversion
toDruidExpressionWithPostAggOperands, toDruidFilter, toPostAggregator
-
Constructor Details
-
DruidUserDefinedTableMacroConversion
public DruidUserDefinedTableMacroConversion(String name, TableDefnRegistry registry, String tableType, com.fasterxml.jackson.databind.ObjectMapper jsonMapper) -
DruidUserDefinedTableMacroConversion
public DruidUserDefinedTableMacroConversion(String name, TableFunction fn, com.fasterxml.jackson.databind.ObjectMapper jsonMapper)
-
-
Method Details
-
calciteOperator
public org.apache.calcite.sql.SqlOperator calciteOperator()Description copied from interface:SqlOperatorConversionReturns the SQL operator corresponding to this function. Should be a singleton.- Specified by:
calciteOperatorin interfaceSqlOperatorConversion- Returns:
- operator
-
toDruidExpression
@Nullable public DruidExpression toDruidExpression(PlannerContext plannerContext, RowSignature rowSignature, org.apache.calcite.rex.RexNode rexNode) Description copied from interface:SqlOperatorConversionTranslate a CalciteRexNodeto a Druid expression.- Specified by:
toDruidExpressionin interfaceSqlOperatorConversion- Parameters:
plannerContext- SQL planner contextrowSignature- signature of the rows to be extracted fromrexNode- expression meant to be applied on top of the rows- Returns:
- Druid expression, or null if translation is not possible
- See Also:
-