Package org.apache.calcite.util
Class Smalls
- java.lang.Object
-
- org.apache.calcite.util.Smalls
-
public class Smalls extends java.lang.Object
Holder for various classes and functions used in tests as user-defined functions and so forth.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Smalls.AllTypesFunction
UDF class that provides user-defined functions for each data type.static class
Smalls.AwkwardFunction
Example of a UDF class that needs to be instantiated but cannot be.static class
Smalls.CountArgs0Function
Example of a UDF that has overloaded UDFs (same name, different args).static class
Smalls.CountArgs1Function
static class
Smalls.CountArgs1NullableFunction
static class
Smalls.CountArgs2Function
static class
Smalls.IntString
Class with int and String fields.static class
Smalls.MazeTable
The real MazeTable may be found in example/function.static class
Smalls.MultipleFunction
UDF class that has multiple methods, some overloaded.static class
Smalls.MyAbcdeFunction
Example of a UDF with named parameters, some of them optional.static class
Smalls.MyDeterministicPlusFunction
AsSmalls.MyPlusFunction
but declared to be deterministic.static class
Smalls.MyDoubleFunction
Example of a UDF with a staticeval
method.private static interface
Smalls.MyGenericAggFunction<A,V,R>
A generic interface for defining user defined aggregate functionsstatic class
Smalls.MyIncrement
User-defined function with two arguments.static class
Smalls.MyLeftFunction
Example of a UDF with named parameters.static class
Smalls.MyPlusFunction
Example of a UDF with a non-staticeval
method, and named parameters.static class
Smalls.MyStaticSumFunction
Example of a user-defined aggregate function (UDAF), whose methods are static.static class
Smalls.MySum3
Example of a user-defined aggregate function that implements a generic interface.static class
Smalls.MySumFunction
Example of a user-defined aggregate function (UDAF).static class
Smalls.MyTableFunction
A table function that returns aQueryableTable
.static class
Smalls.MyThreeParamsSumFunctionWithFilter1
Example of a user-defined aggregate function (UDAF), whose methods are static.static class
Smalls.MyThreeParamsSumFunctionWithFilter2
Example of a user-defined aggregate function (UDAF), whose methods are static.static class
Smalls.MyToStringFunction
Example of a non-strict UDF.static class
Smalls.MyTwoParamsSumFunctionFilter1
Example of a user-defined aggregate function (UDAF).static class
Smalls.MyTwoParamsSumFunctionFilter2
Example of a user-defined aggregate function (UDAF).static class
Smalls.Null4Function
Example of a semi-strict UDF.static class
Smalls.Null8Function
Example of a picky, semi-strict UDF.static class
Smalls.SimpleTableFunction
A table function that returns aQueryableTable
.static class
Smalls.StaticTableMacroFunction
User-defined table-macro function whose eval method is static.static class
Smalls.SumFunctionBadIAdd
User-defined function.static class
Smalls.TableMacroFunction
User-defined table-macro function.static class
Smalls.TableMacroFunctionWithNamedParameters
User-defined table-macro function with named and optional parameters.static class
Smalls.TestStaticTableFunction
A table function that returns aQueryableTable
via a static method.static class
Smalls.WideProductSale
Table with a lot of columns.static class
Smalls.WideSaleSchema
Schema containing aprod
table with a lot of columns.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.reflect.Method
FIBONACCI_TABLE_METHOD
static java.lang.reflect.Method
FIBONACCI2_TABLE_METHOD
static java.lang.reflect.Method
GENERATE_STRINGS_METHOD
static java.lang.reflect.Method
MAZE_METHOD
static java.lang.reflect.Method
MAZE2_METHOD
static java.lang.reflect.Method
MAZE3_METHOD
static java.lang.reflect.Method
MULTIPLICATION_TABLE_METHOD
static java.lang.reflect.Method
PROCESS_CURSOR_METHOD
static java.lang.reflect.Method
PROCESS_CURSORS_METHOD
static java.lang.reflect.Method
STR_METHOD
static java.lang.reflect.Method
STRING_UNION_METHOD
static java.lang.reflect.Method
VIEW_METHOD
-
Constructor Summary
Constructors Modifier Constructor Description private
Smalls()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static org.apache.calcite.schema.ScannableTable
fibonacciTable()
A function that generates the Fibonacci sequence.static org.apache.calcite.schema.ScannableTable
fibonacciTableWithLimit(long limit)
A function that generates the Fibonacci sequence.static org.apache.calcite.schema.QueryableTable
generateStrings(java.lang.Integer count)
A function that generates a table that generates a sequence ofSmalls.IntString
values.static org.apache.calcite.schema.QueryableTable
multiplicationTable(int ncol, int nrow, java.lang.Integer offset)
A function that generates multiplication table ofncol
columns xnrow
rows.private static org.apache.calcite.schema.QueryableTable
oneThreePlus(java.lang.String s)
static org.apache.calcite.schema.QueryableTable
processCursor(int offset, org.apache.calcite.linq4j.Enumerable<java.lang.Object[]> a)
A function that adds a number to the first column of input cursorstatic org.apache.calcite.schema.QueryableTable
processCursors(int offset, org.apache.calcite.linq4j.Enumerable<java.lang.Object[]> a, org.apache.calcite.linq4j.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 org.apache.calcite.schema.TranslatableTable
str(java.lang.Object o, java.lang.Object p)
static <T> org.apache.calcite.linq4j.Queryable<T>
stringUnion(org.apache.calcite.linq4j.Queryable<T> q0, org.apache.calcite.linq4j.Queryable<T> q1)
static org.apache.calcite.schema.TranslatableTable
strView(java.lang.String s)
static org.apache.calcite.schema.TranslatableTable
view(java.lang.String s)
-
-
-
Field Detail
-
GENERATE_STRINGS_METHOD
public static final java.lang.reflect.Method GENERATE_STRINGS_METHOD
-
MAZE_METHOD
public static final java.lang.reflect.Method MAZE_METHOD
-
MAZE2_METHOD
public static final java.lang.reflect.Method MAZE2_METHOD
-
MAZE3_METHOD
public static final java.lang.reflect.Method MAZE3_METHOD
-
MULTIPLICATION_TABLE_METHOD
public static final java.lang.reflect.Method MULTIPLICATION_TABLE_METHOD
-
FIBONACCI_TABLE_METHOD
public static final java.lang.reflect.Method FIBONACCI_TABLE_METHOD
-
FIBONACCI2_TABLE_METHOD
public static final java.lang.reflect.Method FIBONACCI2_TABLE_METHOD
-
VIEW_METHOD
public static final java.lang.reflect.Method VIEW_METHOD
-
STR_METHOD
public static final java.lang.reflect.Method STR_METHOD
-
STRING_UNION_METHOD
public static final java.lang.reflect.Method STRING_UNION_METHOD
-
PROCESS_CURSOR_METHOD
public static final java.lang.reflect.Method PROCESS_CURSOR_METHOD
-
PROCESS_CURSORS_METHOD
public static final java.lang.reflect.Method PROCESS_CURSORS_METHOD
-
-
Method Detail
-
oneThreePlus
private static org.apache.calcite.schema.QueryableTable oneThreePlus(java.lang.String s)
-
stringUnion
public static <T> org.apache.calcite.linq4j.Queryable<T> stringUnion(org.apache.calcite.linq4j.Queryable<T> q0, org.apache.calcite.linq4j.Queryable<T> q1)
-
generateStrings
public static org.apache.calcite.schema.QueryableTable generateStrings(java.lang.Integer count)
A function that generates a table that generates a sequence ofSmalls.IntString
values.
-
multiplicationTable
public static org.apache.calcite.schema.QueryableTable multiplicationTable(int ncol, int nrow, java.lang.Integer offset)
A function that generates multiplication table ofncol
columns xnrow
rows.
-
fibonacciTable
public static org.apache.calcite.schema.ScannableTable fibonacciTable()
A function that generates the Fibonacci sequence. Interesting because it has one column and no arguments.
-
fibonacciTableWithLimit
public static org.apache.calcite.schema.ScannableTable fibonacciTableWithLimit(long limit)
A function that generates the Fibonacci sequence. Interesting because it has one column and no arguments.
-
processCursor
public static org.apache.calcite.schema.QueryableTable processCursor(int offset, org.apache.calcite.linq4j.Enumerable<java.lang.Object[]> a)
A function that adds a number to the first column of input cursor
-
processCursors
public static org.apache.calcite.schema.QueryableTable processCursors(int offset, org.apache.calcite.linq4j.Enumerable<java.lang.Object[]> a, org.apache.calcite.linq4j.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
public static org.apache.calcite.schema.TranslatableTable view(java.lang.String s)
-
strView
public static org.apache.calcite.schema.TranslatableTable strView(java.lang.String s)
-
str
public static org.apache.calcite.schema.TranslatableTable str(java.lang.Object o, java.lang.Object p)
-
-