com.mapd.calcite.parser.HeavyDBSqlOperatorTable.ExtTableFunction.ExtTableFunction |
( |
final String |
name, |
|
|
final ExtensionFunction |
sig |
|
) |
| |
|
inlinepackage |
Definition at line 2983 of file HeavyDBSqlOperatorTable.java.
2985 SqlKind.OTHER_FUNCTION,
2989 SqlFunctionCategory.USER_DEFINED_TABLE_FUNCTION);
2991 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 3306 of file HeavyDBSqlOperatorTable.java.
References Double, Float, and Integer.
3307 if (value instanceof
Integer || value instanceof Long || value instanceof
Float
3308 || value instanceof
Double) {
3309 return SqlLiteral.createExactNumeric(value.toString(), pos);
3310 }
else if (value instanceof Boolean) {
3311 Boolean asBool = (Boolean) value;
3312 return SqlLiteral.createBoolean(asBool.booleanValue(), pos);
3313 }
else if (value instanceof String) {
3314 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 3195 of file HeavyDBSqlOperatorTable.java.
References com.mapd.parser.server.ExtensionFunction.ExtArgumentType.Cursor.
3200 if (getClass() != obj.getClass()) {
3209 if (!this.getName().equals(other.getName())) {
3212 if (
arg_types.size() != other.arg_types.size()) {
3216 for (
int i = 0; i < arg_types.size(); i++) {
3217 if (
arg_types.get(i) != other.arg_types.get(i)) {
3221 String paramName = this.arg_names.get(i);
3222 String otherParamName = other.getExtendedParamNames().
get(i);
3223 if (!paramName.equals(otherParamName)) {
3227 List<ExtArgumentType> field_types = this.getCursorFieldTypes().
get(paramName);
3228 List<ExtArgumentType> other_field_types =
3229 other.getCursorFieldTypes().
get(paramName);
3230 if (field_types.size() != other_field_types.size()) {
3233 for (
int j = 0; j < field_types.size(); j++) {
3234 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 3084 of file HeavyDBSqlOperatorTable.java.
References Integer.
3085 final Boolean debugMode =
false;
3086 Set<RelColumnMapping> s =
new HashSet<RelColumnMapping>();
3090 if (
Integer.valueOf(
options.getOrDefault(
"filter_table_function_transpose",
"0"))
3092 debugPrint(
"getNameAsId() -> " + getNameAsId(), debugMode);
3094 for (
int arg_idx = 0; arg_idx < arg_names.size(); ++arg_idx) {
3095 String arg_name = arg_names.get(arg_idx);
3097 int start = arg_name.indexOf(
"[");
3100 int end = arg_name.lastIndexOf(
"]");
3101 fields = arg_name.substring(start + 1, end)
3102 .replaceAll(
"\\s+",
"")
3105 fields =
new String[] {arg_name};
3107 debugPrint(
"fields=" + Arrays.toString(fields), debugMode);
3108 for (
int field_idx = 0; field_idx < fields.length; ++field_idx) {
3109 int out_idx = out_names.indexOf(fields[field_idx]);
3111 s.add(
new RelColumnMapping(out_idx, rel_idx, field_idx,
false));
3112 debugPrint(
"out_idx, arg_idx/rel_idx, field_idx=" + out_idx +
", " + arg_idx
3113 +
"/" + 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 3131 of file HeavyDBSqlOperatorTable.java.
References File_Namespace.append(), com.mapd.parser.server.ExtensionFunction.ExtArgumentType.Cursor, and run_benchmark_import.type.
3132 StringBuilder ret =
new StringBuilder();
3134 ret.append(this.getName());
3137 for (
int i = 0; i < this.arg_types.size(); i++) {
3143 String paramName = arg_names.get(i);
3144 ret.append(paramName).
append(
" => ");
3146 final String t = type.toString().toUpperCase(Locale.ROOT);
3147 ret.append(
"<").
append(t);
3149 List<ExtensionFunction.ExtArgumentType> field_types =
3150 cursor_field_types.get(paramName);
3152 for (
int j = 0; j < field_types.size(); j++) {
3157 ret.append(toSqlTypeName(field_type));
3158 if (isColumnListType(field_type)) {
3161 ret.append(toSqlTypeName(subtype));
3163 }
else if (isColumnArrayType(field_type) || isArrayType(field_type)) {
3166 ret.append(toSqlTypeName(subtype));
3176 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 3023 of file HeavyDBSqlOperatorTable.java.
References run_benchmark_import.type.
3024 final Boolean has_names = this.pretty_arg_names != null
3025 && this.pretty_arg_names.size() == this.
arg_types.size();
3026 final List<FunctionParameter> parameters =
new java.util.ArrayList<>();
3027 for (
int i = 0; i < this.arg_types.size(); i++) {
3028 final int arg_idx = i;
3029 parameters.add(
new FunctionParameter() {
3030 public int getOrdinal() {
3034 public String getName() {
3036 return pretty_arg_names.get(arg_idx);
3038 return "arg" + arg_idx;
3041 public RelDataType getType(RelDataTypeFactory typeFactory) {
3042 SqlTypeFamily
type = toSqlTypeName(
arg_types.get(arg_idx)).getFamily();
3043 return type.getDefaultConcreteType(typeFactory);
3046 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 3055 of file HeavyDBSqlOperatorTable.java.
References com.mapd.parser.server.ExtensionFunction.isColumnArrayType(), and run_benchmark_import.type.
3056 return opBinding -> {
3057 RelDataTypeFactory fact = opBinding.getTypeFactory();
3058 FieldInfoBuilder ret = fact.builder();
3059 for (
int out_idx = 0; out_idx < outs.size(); ++out_idx) {
3061 if (toSqlTypeName(
outs.get(out_idx)) == SqlTypeName.ARRAY) {
3064 extSubType = getValueType(extSubType);
3066 RelDataType subtype = fact.createSqlType(toSqlTypeName(extSubType));
3067 type = fact.createArrayType(subtype, -1);
3069 type = fact.createSqlType(toSqlTypeName(
outs.get(out_idx)));
3071 ret = ret.add(out_names.get(out_idx), type);
3072 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 3289 of file HeavyDBSqlOperatorTable.java.
3290 for (Ord<SqlNode> operand : Ord.zip(permutedCall.getOperandList())) {
3291 if (operand.e.getClass() == SqlBasicCall.class) {
3292 SqlBasicCall operandAsCall = (SqlBasicCall) operand.e;
3293 if (operandAsCall.getOperator().getName() ==
"DEFAULT") {
3295 String paramName = tf.getExtendedParamNames().
get(operand.i);
3296 Comparable<?> defaultVal = tf.getDefaultValues().
get(paramName);
3298 defaultVal, operand.e.getParserPosition());
3299 permutedCall.setOperand(operand.i, newOperand);
3303 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: