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
Modifier and TypeClassDescriptionstatic class
UDF class that provides user-defined functions for each data type.static class
User-defined table-macro function with named and optional parameters.static class
Example of a UDF class that needs to be instantiated but cannot be.static class
Example of a UDF that has overloaded UDFs (same name, different args).static class
static class
static class
static class
Example of a UDF with non-default constructor.static class
A table function that returns its input value.static class
Class with int and String fields.static class
The real MazeTable may be found in example/function.static class
UDF class that has multiple methods, some overloaded.static class
Example of a UDF with named parameters, some of them optional.static class
AsSmalls.MyPlusFunction
but declared to be deterministic.static class
Example of a UDF with a staticeval
method.static class
User-defined function that declares exceptions.static class
User-defined function with two arguments.static class
Example of a UDF with named parameters.static class
Example of a UDF with a non-staticeval
method, and named parameters.static class
AsSmalls.MyPlusFunction
but constructor has aFunctionContext
parameter.static class
Example of a user-defined aggregate function (UDAF), whose methods are static.static class
Example of a user-defined aggregate function that implements a generic interface.static class
Example of a user-defined aggregate function (UDAF).static class
A table function that returns aQueryableTable
.static class
Example of a user-defined aggregate function (UDAF), whose methods are static.static class
Example of a user-defined aggregate function (UDAF), whose methods are static.static class
Example of a non-strict UDF.static class
Example of a user-defined aggregate function (UDAF) with two parameters.static class
Another example of a user-defined aggregate function (UDAF) with two parameters.static class
Example of a semi-strict UDF.static class
Example of a picky, semi-strict UDF.static class
Table with columns (A, B).static class
A table function that returns aQueryableTable
.static class
Implementation ofTableMacro
interface withSmalls.SimpleTableMacro.apply(java.util.List<?>)
method that returnsQueryable
table.static class
User-defined table-macro function whose eval method is static.static class
User-defined function.static class
User-defined table-macro function.static class
User-defined table-macro function with named and optional parameters.static class
A table function that returns aQueryableTable
via a static method.static class
Table with a lot of columns.static class
Schema containing aprod
table with a lot of columns. -
Field Summary
Modifier and TypeFieldDescriptionstatic final Method
static final Method
static final Method
static final Method
static final Method
static final Method
static final Method
static final Method
static final Method
static final Method
static final Method
static final Method
static final Method
static final Method
static final Method
static final Method
static final Method
static final Method
static final Method
static final Method
-
Method Summary
Modifier and TypeMethodDescriptionstatic ScannableTable
dummyTableFuncWithTwoParams
(long param1, long param2) A function that takes 2 param as input.static ScannableTable
dynamicRowTypeTable
(String jsonRowType, int rowCount) static ScannableTable
A function that generates the Fibonacci sequence.static ScannableTable
fibonacciTableWithLimit
(long limit) A function that generates the Fibonacci sequence.static ScannableTable
A function that generates the first 100 terms of the Fibonacci sequence.static QueryableTable
generateStrings
(Integer count) A function that generates a table that generates a sequence ofSmalls.IntString
values.static QueryableTable
static QueryableTable
static QueryableTable
multiplicationTable
(int ncol, int nrow, Integer offset) A function that generates multiplication table ofncol
columns xnrow
rows.static QueryableTable
processCursor
(int offset, Enumerable<Object[]> a) Table function that adds a number to the first column of input cursor.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.static TranslatableTable
static <T> Queryable<T>
stringUnion
(Queryable<T> q0, Queryable<T> q1) static TranslatableTable
static 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.IntString
values. -
generateStringsOfInputSize
-
generateStringsOfInputMapSize
-
multiplicationTable
A function that generates multiplication table ofncol
columns xnrow
rows. -
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
-