[
https://issues.apache.org/jira/browse/FLINK-1913?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15953118#comment-15953118
]
Fabian Hueske commented on FLINK-1913:
--------------------------------------
Hi [~prabhu1984],
I think the HCatalog connector hasn't been used a lot so far.
I would try to use it as follows.
{code}
ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
// configure connection to HCatalog
Configuration conf = new Configuration();
// create input format
InputFormat hcatIF =
new HCatInputFormat<>("myDB", "persons", conf)
.getFields("id", "name", "address", "age")
.asFlinkTuples();
// define TypeInfo
TupleTypeInfo<Tuple4<Long, String, String, Integer>> tInfo = new
TupleTypeInfo<>(
BasicTypeInfo.LONG_TYPE_INFO,
BasicTypeInfo.STRING_TYPE_INFO,
BasicTypeInfo.STRING_TYPE_INFO,
BasicTypeInfo.INT_TYPE_INFO
);
// use input format
DataSet<Tuple4<Long, String, String, Integer>> data = env.createInput(hcatIF,
tInfo);
{code}
Would be nice if you could check if this is working and contribute the missing
documentation.
Thanks, Fabian
> Document how to access data in HCatalog
> ---------------------------------------
>
> Key: FLINK-1913
> URL: https://issues.apache.org/jira/browse/FLINK-1913
> Project: Flink
> Issue Type: Bug
> Components: Documentation, flink-hcatalog
> Reporter: Robert Metzger
>
> Reading from HCatalog was added in FLINK-1466, but not documented
> We should document how to use the code in {{flink-hcatalog}}.
> Also, there should be an example on how to write to HCatalog using the Hadoop
> wrappers.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)