public class JDBCLookupFunction
extends org.apache.flink.table.functions.TableFunction<org.apache.flink.types.Row>
TableFunction to query fields from JDBC by keys.
The query template like:
SELECT c, d, e, f from T where a = ? and b = ?
Support cache the result to avoid frequent accessing to remote databases. 1.The cacheMaxSize is -1 means not use cache. 2.For real-time data, you need to set the TTL of cache.
| 限定符和类型 | 类和说明 |
|---|---|
static class |
JDBCLookupFunction.Builder
Builder for a
JDBCLookupFunction. |
| 构造器和说明 |
|---|
JDBCLookupFunction(JDBCOptions options,
JDBCLookupOptions lookupOptions,
String[] fieldNames,
org.apache.flink.api.common.typeinfo.TypeInformation[] fieldTypes,
String[] keyNames) |
| 限定符和类型 | 方法和说明 |
|---|---|
static JDBCLookupFunction.Builder |
builder() |
void |
close() |
void |
eval(Object... keys) |
org.apache.flink.api.common.typeinfo.TypeInformation<?>[] |
getParameterTypes(Class<?>[] signature) |
org.apache.flink.api.common.typeinfo.TypeInformation<org.apache.flink.types.Row> |
getResultType() |
void |
open(org.apache.flink.table.functions.FunctionContext context) |
public JDBCLookupFunction(JDBCOptions options, JDBCLookupOptions lookupOptions, String[] fieldNames, org.apache.flink.api.common.typeinfo.TypeInformation[] fieldTypes, String[] keyNames)
public static JDBCLookupFunction.Builder builder()
public void open(org.apache.flink.table.functions.FunctionContext context)
throws Exception
open 在类中 org.apache.flink.table.functions.UserDefinedFunctionExceptionpublic void eval(Object... keys)
public void close()
throws IOException
close 在类中 org.apache.flink.table.functions.UserDefinedFunctionIOExceptionpublic org.apache.flink.api.common.typeinfo.TypeInformation<org.apache.flink.types.Row> getResultType()
getResultType 在类中 org.apache.flink.table.functions.TableFunction<org.apache.flink.types.Row>public org.apache.flink.api.common.typeinfo.TypeInformation<?>[] getParameterTypes(Class<?>[] signature)
getParameterTypes 在类中 org.apache.flink.table.functions.TableFunction<org.apache.flink.types.Row>Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.