Class DruidTableMacro
java.lang.Object
org.apache.druid.sql.calcite.external.DruidTableMacro
- All Implemented Interfaces:
org.apache.calcite.schema.Function,org.apache.calcite.schema.TableMacro,SchemaAwareUserDefinedTableMacro.ExtendedTableMacro
public class DruidTableMacro
extends Object
implements SchemaAwareUserDefinedTableMacro.ExtendedTableMacro
Table macro which wraps a catalog table function and which accepts
a schema from an EXTENDS clause. This macro is wrapped by the
DruidUserDefinedTableMacro operator that itself extends
SchemaAwareUserDefinedTableMacro which interfaces with the
extend operator to pass the schema via a "back channel." The plumbing
is complex because we're adding functionality a bit outside the SQL
standard, and we have to fit our logic into the Calcite stack.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDruidTableMacro(String name, TableFunction fn, com.fasterxml.jackson.databind.ObjectMapper jsonMapper) -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.calcite.schema.TranslatableTableCalled when the function is used without anEXTENDclause.org.apache.calcite.schema.TranslatableTablecom.fasterxml.jackson.databind.ObjectMapperList<org.apache.calcite.schema.FunctionParameter>
-
Field Details
-
name
-
-
Constructor Details
-
DruidTableMacro
public DruidTableMacro(String name, TableFunction fn, com.fasterxml.jackson.databind.ObjectMapper jsonMapper)
-
-
Method Details
-
apply
Called when the function is used without anEXTENDclause.EXTERNallows this, most others do not.- Specified by:
applyin interfaceorg.apache.calcite.schema.TableMacro
-
apply
public org.apache.calcite.schema.TranslatableTable apply(List<?> arguments, org.apache.calcite.sql.SqlNodeList schema) - Specified by:
applyin interfaceSchemaAwareUserDefinedTableMacro.ExtendedTableMacro
-
getParameters
- Specified by:
getParametersin interfaceorg.apache.calcite.schema.Function
-
getJsonMapper
public com.fasterxml.jackson.databind.ObjectMapper getJsonMapper()
-