com.mapd.calcite.parser.HeavyDBSqlOperatorTable.ExtTableFunction.ExtTableFunction |
( |
final String |
name, |
|
|
final ExtensionFunction |
sig |
|
) |
| |
|
inlinepackage |
Definition at line 3124 of file HeavyDBSqlOperatorTable.java.
3126 SqlKind.OTHER_FUNCTION,
3130 SqlFunctionCategory.USER_DEFINED_TABLE_FUNCTION);
3132 outs = sig.getOuts();
final Map< String, String > options
final List< ExtArgumentType > outs
final List< ExtArgumentType > arg_types
HeavyDBSqlOperatorTable(SqlOperatorTable parentTable)
final List< String > out_names
final Map< String, List< ExtArgumentType > > cursor_field_types
final List< String > arg_names
final List< String > pretty_arg_names
final Map< String, Comparable<?> > default_values
boolean com.mapd.calcite.parser.HeavyDBSqlOperatorTable.ExtTableFunction.checkOperandTypes |
( |
SqlCallBinding |
callBinding, |
|
|
boolean |
throwOnFailure |
|
) |
| |
|
inline |
SqlLiteral com.mapd.calcite.parser.HeavyDBSqlOperatorTable.ExtTableFunction.createLiteralForDefaultValue |
( |
Comparable<?> |
value, |
|
|
SqlParserPos |
pos |
|
) |
| |
|
inlinepackage |
Definition at line 3447 of file HeavyDBSqlOperatorTable.java.
References Double, Float, and Integer.
3448 if (value instanceof
Integer || value instanceof Long || value instanceof
Float
3449 || value instanceof
Double) {
3450 return SqlLiteral.createExactNumeric(value.toString(), pos);
3451 }
else if (value instanceof Boolean) {
3452 Boolean asBool = (Boolean) value;
3453 return SqlLiteral.createBoolean(asBool.booleanValue(), pos);
3454 }
else if (value instanceof String) {
3455 return SqlLiteral.createCharString(value.toString(), pos);
void com.mapd.calcite.parser.HeavyDBSqlOperatorTable.ExtTableFunction.debugPrint |
( |
String |
msg, |
|
|
Boolean |
debugMode |
|
) |
| |
|
inlineprivate |
boolean com.mapd.calcite.parser.HeavyDBSqlOperatorTable.ExtTableFunction.equals |
( |
final Object |
obj | ) |
|
|
inline |
Definition at line 3336 of file HeavyDBSqlOperatorTable.java.
References com.mapd.parser.server.ExtensionFunction.ExtArgumentType.Cursor.
3341 if (getClass() != obj.getClass()) {
3350 if (!this.getName().equals(other.getName())) {
3353 if (
arg_types.size() != other.arg_types.size()) {
3357 for (
int i = 0; i < arg_types.size(); i++) {
3358 if (
arg_types.get(i) != other.arg_types.get(i)) {
3362 String paramName = this.arg_names.get(i);
3363 String otherParamName = other.getExtendedParamNames().
get(i);
3364 if (!paramName.equals(otherParamName)) {
3368 List<ExtArgumentType> field_types = this.getCursorFieldTypes().
get(paramName);
3369 List<ExtArgumentType> other_field_types =
3370 other.getCursorFieldTypes().
get(paramName);
3371 if (field_types.size() != other_field_types.size()) {
3374 for (
int j = 0; j < field_types.size(); j++) {
3375 if (field_types.get(j) != other_field_types.get(j)) {
ExtTableFunction(final String name, final ExtensionFunction sig)
final List< ExtArgumentType > arg_types
List<ExtArgumentType> com.mapd.calcite.parser.HeavyDBSqlOperatorTable.ExtTableFunction.getArgTypes |
( |
| ) |
|
|
inline |
Set<RelColumnMapping> com.mapd.calcite.parser.HeavyDBSqlOperatorTable.ExtTableFunction.getColumnMappings |
( |
| ) |
|
|
inline |
Definition at line 3225 of file HeavyDBSqlOperatorTable.java.
References Integer.
3226 final Boolean debugMode =
false;
3227 Set<RelColumnMapping> s =
new HashSet<RelColumnMapping>();
3231 if (
Integer.valueOf(
options.getOrDefault(
"filter_table_function_transpose",
"0"))
3233 debugPrint(
"getNameAsId() -> " + getNameAsId(), debugMode);
3235 for (
int arg_idx = 0; arg_idx < arg_names.size(); ++arg_idx) {
3236 String arg_name = arg_names.get(arg_idx);
3238 int start = arg_name.indexOf(
"[");
3241 int end = arg_name.lastIndexOf(
"]");
3242 fields = arg_name.substring(start + 1, end)
3243 .replaceAll(
"\\s+",
"")
3246 fields =
new String[] {arg_name};
3248 debugPrint(
"fields=" + Arrays.toString(fields), debugMode);
3249 for (
int field_idx = 0; field_idx < fields.length; ++field_idx) {
3250 int out_idx = out_names.indexOf(fields[field_idx]);
3252 s.add(
new RelColumnMapping(out_idx, rel_idx, field_idx,
false));
3253 debugPrint(
"out_idx, arg_idx/rel_idx, field_idx=" + out_idx +
", " + arg_idx
3254 +
"/" + rel_idx +
", " + field_idx,
final Map< String, String > options
void debugPrint(String msg, Boolean debugMode)
final List< String > out_names
final List< String > arg_names
Map<String, List<ExtArgumentType> > com.mapd.calcite.parser.HeavyDBSqlOperatorTable.ExtTableFunction.getCursorFieldTypes |
( |
| ) |
|
|
inline |
Map<String, Comparable<?> > com.mapd.calcite.parser.HeavyDBSqlOperatorTable.ExtTableFunction.getDefaultValues |
( |
| ) |
|
|
inlinepackage |
List<String> com.mapd.calcite.parser.HeavyDBSqlOperatorTable.ExtTableFunction.getExtendedParamNames |
( |
| ) |
|
|
inline |
String com.mapd.calcite.parser.HeavyDBSqlOperatorTable.ExtTableFunction.getExtendedSignature |
( |
| ) |
|
|
inline |
Definition at line 3272 of file HeavyDBSqlOperatorTable.java.
References File_Namespace.append(), com.mapd.parser.server.ExtensionFunction.ExtArgumentType.Cursor, and run_benchmark_import.type.
3273 StringBuilder ret =
new StringBuilder();
3275 ret.append(this.getName());
3278 for (
int i = 0; i < this.arg_types.size(); i++) {
3284 String paramName = arg_names.get(i);
3285 ret.append(paramName).
append(
" => ");
3287 final String t = type.toString().toUpperCase(Locale.ROOT);
3288 ret.append(
"<").
append(t);
3290 List<ExtensionFunction.ExtArgumentType> field_types =
3291 cursor_field_types.get(paramName);
3293 for (
int j = 0; j < field_types.size(); j++) {
3298 ret.append(toSqlTypeName(field_type));
3299 if (isColumnListType(field_type)) {
3302 ret.append(toSqlTypeName(subtype));
3304 }
else if (isColumnArrayType(field_type) || isArrayType(field_type)) {
3307 ret.append(toSqlTypeName(subtype));
3317 return ret.toString();
size_t append(FILE *f, const size_t size, const int8_t *buf)
Appends the specified number of bytes to the end of the file f from buf.
int com.mapd.calcite.parser.HeavyDBSqlOperatorTable.ExtTableFunction.getNumOptionalArguments |
( |
| ) |
|
|
inline |
List<FunctionParameter> com.mapd.calcite.parser.HeavyDBSqlOperatorTable.ExtTableFunction.getParameters |
( |
| ) |
|
|
inline |
Definition at line 3164 of file HeavyDBSqlOperatorTable.java.
References run_benchmark_import.type.
3165 final Boolean has_names = this.pretty_arg_names != null
3166 && this.pretty_arg_names.size() == this.
arg_types.size();
3167 final List<FunctionParameter> parameters =
new java.util.ArrayList<>();
3168 for (
int i = 0; i < this.arg_types.size(); i++) {
3169 final int arg_idx = i;
3170 parameters.add(
new FunctionParameter() {
3171 public int getOrdinal() {
3175 public String getName() {
3177 return pretty_arg_names.get(arg_idx);
3179 return "arg" + arg_idx;
3182 public RelDataType getType(RelDataTypeFactory typeFactory) {
3183 SqlTypeFamily
type = toSqlTypeName(
arg_types.get(arg_idx)).getFamily();
3184 return type.getDefaultConcreteType(typeFactory);
3187 public boolean isOptional() {
final List< ExtArgumentType > arg_types
List<String> com.mapd.calcite.parser.HeavyDBSqlOperatorTable.ExtTableFunction.getParamNames |
( |
| ) |
|
|
inline |
SqlReturnTypeInference com.mapd.calcite.parser.HeavyDBSqlOperatorTable.ExtTableFunction.getRowTypeInference |
( |
| ) |
|
|
inline |
Definition at line 3196 of file HeavyDBSqlOperatorTable.java.
References com.mapd.parser.server.ExtensionFunction.isColumnArrayType(), and run_benchmark_import.type.
3197 return opBinding -> {
3198 RelDataTypeFactory fact = opBinding.getTypeFactory();
3199 FieldInfoBuilder ret = fact.builder();
3200 for (
int out_idx = 0; out_idx < outs.size(); ++out_idx) {
3202 if (toSqlTypeName(
outs.get(out_idx)) == SqlTypeName.ARRAY) {
3205 extSubType = getValueType(extSubType);
3207 RelDataType subtype = fact.createSqlType(toSqlTypeName(extSubType));
3208 type = fact.createArrayType(subtype, -1);
3210 type = fact.createSqlType(toSqlTypeName(
outs.get(out_idx)));
3212 ret = ret.add(out_names.get(out_idx), type);
3213 ret = ret.nullable(
true);
final List< ExtArgumentType > outs
int com.mapd.calcite.parser.HeavyDBSqlOperatorTable.ExtTableFunction.hashCode |
( |
| ) |
|
|
inline |
boolean com.mapd.calcite.parser.HeavyDBSqlOperatorTable.ExtTableFunction.isArgumentOptional |
( |
int |
i | ) |
|
|
inline |
SqlCall com.mapd.calcite.parser.HeavyDBSqlOperatorTable.ExtTableFunction.rewriteCallWithDefaultArguments |
( |
SqlCall |
permutedCall | ) |
|
|
inline |
Definition at line 3430 of file HeavyDBSqlOperatorTable.java.
3431 for (Ord<SqlNode> operand : Ord.zip(permutedCall.getOperandList())) {
3432 if (operand.e.getClass() == SqlBasicCall.class) {
3433 SqlBasicCall operandAsCall = (SqlBasicCall) operand.e;
3434 if (operandAsCall.getOperator().getName() ==
"DEFAULT") {
3436 String paramName = tf.getExtendedParamNames().
get(operand.i);
3437 Comparable<?> defaultVal = tf.getDefaultValues().
get(paramName);
3439 defaultVal, operand.e.getParserPosition());
3440 permutedCall.setOperand(operand.i, newOperand);
3444 return permutedCall;
ExtTableFunction(final String name, final ExtensionFunction sig)
SqlLiteral createLiteralForDefaultValue(Comparable<?> value, SqlParserPos pos)
boolean com.mapd.calcite.parser.HeavyDBSqlOperatorTable.ExtTableFunction.supportsDefaultArguments |
( |
| ) |
|
|
inline |
String com.mapd.calcite.parser.HeavyDBSqlOperatorTable.ExtTableFunction.toString |
( |
| ) |
|
|
inline |
final List<String> com.mapd.calcite.parser.HeavyDBSqlOperatorTable.ExtTableFunction.arg_names |
|
private |
final List<ExtArgumentType> com.mapd.calcite.parser.HeavyDBSqlOperatorTable.ExtTableFunction.arg_types |
|
private |
final Map<String, List<ExtArgumentType> > com.mapd.calcite.parser.HeavyDBSqlOperatorTable.ExtTableFunction.cursor_field_types |
|
private |
final Map<String, Comparable<?> > com.mapd.calcite.parser.HeavyDBSqlOperatorTable.ExtTableFunction.default_values |
|
private |
final Map<String, String> com.mapd.calcite.parser.HeavyDBSqlOperatorTable.ExtTableFunction.options |
|
private |
final List<String> com.mapd.calcite.parser.HeavyDBSqlOperatorTable.ExtTableFunction.out_names |
|
private |
final List<ExtArgumentType> com.mapd.calcite.parser.HeavyDBSqlOperatorTable.ExtTableFunction.outs |
|
private |
final List<String> com.mapd.calcite.parser.HeavyDBSqlOperatorTable.ExtTableFunction.pretty_arg_names |
|
private |
The documentation for this class was generated from the following file: