ccciudatu commented on a change in pull request #13572:
URL: https://github.com/apache/beam/pull/13572#discussion_r546292187
##########
File path:
sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/meta/provider/kafka/KafkaTableProvider.java
##########
@@ -85,6 +89,33 @@ public BeamSqlTable buildBeamSqlTable(Table table) {
} catch (ClassNotFoundException e) {
throw new IllegalArgumentException("Incorrect proto class provided:
" + protoClassName);
}
+ case THRIFT:
+ final String thriftClassName = properties.getString("thriftClass");
Review comment:
Everything else was inlined here, so I thought I'd keep it "consistent".
But you're right, thrift also requires a protocol spec, which makes it even
more involved than the proto case, so it probably deserves its own method.
##########
File path: sdks/java/extensions/sql/src/test/thrift/kafka/message.thrift
##########
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+thrift --gen java:private-members \
Review comment:
I initially tried to generate java code from thrift "on the fly" using
the `thrift-gradle-plugin`, but it turns out `thrift` is not installed on the
Jenkins servers so the build fails. That's why I had to document how the code
is to be generated manually.
##########
File path: CHANGES.md
##########
@@ -66,6 +66,7 @@
* Added Cloud Bigtable Provider extension to Beam SQL
([BEAM-11173](https://issues.apache.org/jira/browse/BEAM-11173),
[BEAM-11373](https://issues.apache.org/jira/browse/BEAM-11373))
* Added a schema provider for thrift data
([BEAM-11338](https://issues.apache.org/jira/browse/BEAM-11338))
* Added combiner packing pipeline optimization to Dataflow runner.
([BEAM-10641](https://issues.apache.org/jira/browse/BEAM-10641))
+* Added support for thrift in KafkaTableProvider
([BEAM-11482](https://issues.apache.org/jira/browse/BEAM-11482))
Review comment:
I wasn't aware of that. I'll look it up and update it, thanks for
pointing it out.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]