Package org.apache.calcite.util
Class Smalls
java.lang.Object
org.apache.calcite.util.Smalls
Holder for various classes and functions used in tests as user-defined
functions and so forth.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classUDF class that provides user-defined functions for each data type.static classUser-defined table-macro function with named and optional parameters.static classExample of a UDF class that needs to be instantiated but cannot be.static classExample of a UDF that has overloaded UDFs (same name, different args).static classstatic classstatic classstatic classExample of a UDF with non-default constructor.static classA table function that returns its input value.static classClass with int and String fields.static classThe real MazeTable may be found in example/function.static classUDF class that has multiple methods, some overloaded.static classExample of a UDF with named parameters, some of them optional.static classAsSmalls.MyPlusFunctionbut declared to be deterministic.static classExample of a UDF with a staticevalmethod.static classUser-defined function that declares exceptions.static classUser-defined function with two arguments.static classExample of a UDF with named parameters.static classUser-defined function with niladic parentheses.static classExample of a UDF with a non-staticevalmethod, and named parameters.static classAsSmalls.MyPlusFunctionbut constructor has aFunctionContextparameter.static classExample of a user-defined aggregate function (UDAF), whose methods are static.static classExample of a user-defined aggregate function that implements a generic interface.static classExample of a user-defined aggregate function (UDAF).static classA table function that returns aQueryableTable.static classExample of a user-defined aggregate function (UDAF), whose methods are static.static classExample of a user-defined aggregate function (UDAF), whose methods are static.static classExample of a non-strict UDF.static classExample of a user-defined aggregate function (UDAF) with two parameters.static classAnother example of a user-defined aggregate function (UDAF) with two parameters.static classExample of a semi-strict UDF.static classExample of a picky, semi-strict UDF.static classTable with columns (A, B).static classA table function that returns aQueryableTable.static classImplementation ofTableMacrointerface withSmalls.SimpleTableMacro.apply(java.util.List<?>)method that returnsQueryabletable.static classUser-defined table-macro function whose eval method is static.static classUser-defined function.static classUser-defined table-macro function.static classUser-defined table-macro function with named and optional parameters.static classA table function that returns aQueryableTablevia a static method.static classTable with a lot of columns.static classSchema containing aprodtable with a lot of columns. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Methodstatic final Methodstatic final Methodstatic final Methodstatic final Methodstatic final Methodstatic final Methodstatic final Methodstatic final Methodstatic final Methodstatic final Methodstatic final Methodstatic final Methodstatic final Methodstatic final Methodstatic final Methodstatic final Methodstatic final Methodstatic final Methodstatic final Method -
Method Summary
Modifier and TypeMethodDescriptionstatic ScannableTabledummyTableFuncWithTwoParams(long param1, long param2) A function that takes 2 param as input.static ScannableTabledynamicRowTypeTable(String jsonRowType, int rowCount) static ScannableTableA function that generates the Fibonacci sequence.static ScannableTablefibonacciTableWithLimit(long limit) A function that generates the Fibonacci sequence.static ScannableTableA function that generates the first 100 terms of the Fibonacci sequence.static QueryableTablegenerateStrings(Integer count) A function that generates a table that generates a sequence ofSmalls.IntStringvalues.static QueryableTablestatic QueryableTablestatic QueryableTablemultiplicationTable(int ncol, int nrow, Integer offset) A function that generates multiplication table ofncolcolumns xnrowrows.static QueryableTableprocessCursor(int offset, Enumerable<Object[]> a) Table function that adds a number to the first column of input cursor.static QueryableTableprocessCursors(int offset, Enumerable<Object[]> a, Enumerable<Smalls.IntString> b) A function that sums the second column of first input cursor, second column of first input and the given int.static TranslatableTablestatic <T> Queryable<T>stringUnion(Queryable<T> q0, Queryable<T> q1) static TranslatableTablestatic TranslatableTable
-
Field Details
-
GENERATE_STRINGS_METHOD
-
GENERATE_STRINGS_OF_INPUT_SIZE_METHOD
-
GENERATE_STRINGS_OF_INPUT_MAP_SIZE_METHOD
-
MAZE_METHOD
-
MAZE2_METHOD
-
MAZE3_METHOD
-
MULTIPLICATION_TABLE_METHOD
-
FIBONACCI_TABLE_METHOD
-
FIBONACCI_LIMIT_100_TABLE_METHOD
-
FIBONACCI_LIMIT_TABLE_METHOD
-
FIBONACCI_INSTANCE_TABLE_METHOD
-
DUMMY_TABLE_METHOD_WITH_TWO_PARAMS
-
DYNAMIC_ROW_TYPE_TABLE_METHOD
-
VIEW_METHOD
-
STR_METHOD
-
STRING_UNION_METHOD
-
PROCESS_CURSOR_METHOD
-
PROCESS_CURSORS_METHOD
-
MY_PLUS_EVAL_METHOD
-
MY_PLUS_INIT_EVAL_METHOD
-
-
Method Details
-
stringUnion
-
generateStrings
A function that generates a table that generates a sequence ofSmalls.IntStringvalues. -
generateStringsOfInputSize
-
generateStringsOfInputMapSize
-
multiplicationTable
A function that generates multiplication table ofncolcolumns xnrowrows. -
fibonacciTable
A function that generates the Fibonacci sequence.Interesting because it has one column and no arguments, and because it is infinite.
-
fibonacciTableWithLimit100
A function that generates the first 100 terms of the Fibonacci sequence.Interesting because it has one column and no arguments.
-
dummyTableFuncWithTwoParams
A function that takes 2 param as input. -
fibonacciTableWithLimit
A function that generates the Fibonacci sequence. Interesting because it has one column and no arguments. -
dynamicRowTypeTable
-
processCursor
Table function that adds a number to the first column of input cursor. -
processCursors
public static QueryableTable processCursors(int offset, Enumerable<Object[]> a, Enumerable<Smalls.IntString> b) A function that sums the second column of first input cursor, second column of first input and the given int. -
view
-
strView
-
str
-