com.mapd.calcite.parser.HeavyDBSqlOperatorTable.ExtTableFunction.ExtTableFunction |
( |
final String |
name, |
|
|
final ExtensionFunction |
sig |
|
) |
| |
|
inlinepackage |
Definition at line 2707 of file HeavyDBSqlOperatorTable.java.
2709 SqlKind.OTHER_FUNCTION,
2713 SqlFunctionCategory.USER_DEFINED_TABLE_FUNCTION);
2715 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
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 2918 of file HeavyDBSqlOperatorTable.java.
References Cursor.
2923 if (getClass() != obj.getClass()) {
2932 if (!this.getName().equals(other.getName())) {
2935 if (
arg_types.size() != other.arg_types.size()) {
2939 for (
int i = 0; i < arg_types.size(); i++) {
2940 if (
arg_types.get(i) != other.arg_types.get(i)) {
2944 String paramName = this.arg_names.get(i);
2945 String otherParamName = other.getExtendedParamNames().
get(i);
2946 if (!paramName.equals(otherParamName)) {
2950 List<ExtArgumentType> field_types = this.getCursorFieldTypes().
get(paramName);
2951 List<ExtArgumentType> other_field_types =
2952 other.getCursorFieldTypes().
get(paramName);
2953 if (field_types.size() != other_field_types.size()) {
2956 for (
int j = 0; j < field_types.size(); j++) {
2957 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 |
( |
| ) |
|
|
inlinepackage |
Set<RelColumnMapping> com.mapd.calcite.parser.HeavyDBSqlOperatorTable.ExtTableFunction.getColumnMappings |
( |
| ) |
|
|
inline |
Definition at line 2807 of file HeavyDBSqlOperatorTable.java.
References Integer.
2808 final Boolean debugMode =
false;
2809 Set<RelColumnMapping> s =
new HashSet<RelColumnMapping>();
2813 if (
Integer.valueOf(
options.getOrDefault(
"filter_table_function_transpose",
"0"))
2815 debugPrint(
"getNameAsId() -> " + getNameAsId(), debugMode);
2817 for (
int arg_idx = 0; arg_idx < arg_names.size(); ++arg_idx) {
2818 String arg_name = arg_names.get(arg_idx);
2820 int start = arg_name.indexOf(
"[");
2823 int end = arg_name.lastIndexOf(
"]");
2824 fields = arg_name.substring(start + 1, end)
2825 .replaceAll(
"\\s+",
"")
2828 fields =
new String[] {arg_name};
2830 debugPrint(
"fields=" + Arrays.toString(fields), debugMode);
2831 for (
int field_idx = 0; field_idx < fields.length; ++field_idx) {
2832 int out_idx = out_names.indexOf(fields[field_idx]);
2834 s.add(
new RelColumnMapping(out_idx, rel_idx, field_idx,
false));
2835 debugPrint(
"out_idx, arg_idx/rel_idx, field_idx=" + out_idx +
", " + arg_idx
2836 +
"/" + 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 |
( |
| ) |
|
|
inlinepackage |
List<String> com.mapd.calcite.parser.HeavyDBSqlOperatorTable.ExtTableFunction.getExtendedParamNames |
( |
| ) |
|
|
inline |
String com.mapd.calcite.parser.HeavyDBSqlOperatorTable.ExtTableFunction.getExtendedSignature |
( |
| ) |
|
|
inline |
Definition at line 2854 of file HeavyDBSqlOperatorTable.java.
References File_Namespace.append(), and run_benchmark_import.type.
2855 StringBuilder ret =
new StringBuilder();
2857 ret.append(this.getName());
2860 for (
int i = 0; i < this.arg_types.size(); i++) {
2866 String paramName = arg_names.get(i);
2867 ret.append(paramName).
append(
" => ");
2869 final String t = type.toString().toUpperCase(Locale.ROOT);
2870 ret.append(
"<").
append(t);
2872 List<ExtensionFunction.ExtArgumentType> field_types =
2873 cursor_field_types.get(paramName);
2875 for (
int j = 0; j < field_types.size(); j++) {
2880 ret.append(toSqlTypeName(field_type));
2881 if (isColumnListType(field_type)) {
2884 ret.append(toSqlTypeName(subtype));
2886 }
else if (isColumnArrayType(field_type) || isArrayType(field_type)) {
2889 ret.append(toSqlTypeName(subtype));
2899 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.
List<FunctionParameter> com.mapd.calcite.parser.HeavyDBSqlOperatorTable.ExtTableFunction.getParameters |
( |
| ) |
|
|
inline |
Definition at line 2746 of file HeavyDBSqlOperatorTable.java.
References run_benchmark_import.type.
2747 final Boolean has_names = this.pretty_arg_names != null
2748 && this.pretty_arg_names.size() == this.
arg_types.size();
2749 final List<FunctionParameter> parameters =
new java.util.ArrayList<>();
2750 for (
int i = 0; i < this.arg_types.size(); i++) {
2751 final int arg_idx = i;
2752 parameters.add(
new FunctionParameter() {
2753 public int getOrdinal() {
2757 public String getName() {
2759 return pretty_arg_names.get(arg_idx);
2761 return "arg" + arg_idx;
2764 public RelDataType getType(RelDataTypeFactory typeFactory) {
2765 SqlTypeFamily
type = toSqlTypeName(
arg_types.get(arg_idx)).getFamily();
2766 return type.getDefaultConcreteType(typeFactory);
2769 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 2778 of file HeavyDBSqlOperatorTable.java.
References com.mapd.parser.server.ExtensionFunction.isColumnArrayType(), and run_benchmark_import.type.
2779 return opBinding -> {
2780 RelDataTypeFactory fact = opBinding.getTypeFactory();
2781 FieldInfoBuilder ret = fact.builder();
2782 for (
int out_idx = 0; out_idx < outs.size(); ++out_idx) {
2784 if (toSqlTypeName(
outs.get(out_idx)) == SqlTypeName.ARRAY) {
2787 extSubType = getValueType(extSubType);
2789 RelDataType subtype = fact.createSqlType(toSqlTypeName(extSubType));
2790 type = fact.createArrayType(subtype, -1);
2792 type = fact.createSqlType(toSqlTypeName(
outs.get(out_idx)));
2794 ret = ret.add(out_names.get(out_idx), type);
2795 ret = ret.nullable(
true);
final List< ExtArgumentType > outs
int com.mapd.calcite.parser.HeavyDBSqlOperatorTable.ExtTableFunction.hashCode |
( |
| ) |
|
|
inline |
String com.mapd.calcite.parser.HeavyDBSqlOperatorTable.ExtTableFunction.toString |
( |
| ) |
|
|
inline |
Definition at line 2967 of file HeavyDBSqlOperatorTable.java.
2968 return new String(getName() +
"("
2970 this.arg_types.stream()
2971 .map(s -> s.toString())
2972 .collect(Collectors.toList()))
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, 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: