You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2020/07/29 07:20:54 UTC

[GitHub] [beam] robertwb commented on a change in pull request #12149: [BEAM-9897] Add cross-language support to SnowflakeIO.Read

robertwb commented on a change in pull request #12149:
URL: https://github.com/apache/beam/pull/12149#discussion_r461132019



##########
File path: sdks/python/apache_beam/io/external/snowflake.py
##########
@@ -0,0 +1,144 @@
+#
+# 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.
+#
+
+# pytype: skip-file
+
+from __future__ import absolute_import
+
+import typing
+
+from past.builtins import unicode
+
+import apache_beam as beam
+from apache_beam.transforms.external import BeamJarExpansionService
+from apache_beam.transforms.external import ExternalTransform
+from apache_beam.transforms.external import NamedTupleBasedPayloadBuilder
+
+__all__ = ['ReadFromSnowflake']
+
+
+def default_io_expansion_service():
+  return BeamJarExpansionService('sdks:java:io:expansion-service:shadowJar')

Review comment:
       Yes, I think going with a separate jar makes sense given its size. 
   
   To do this, create a rule for a fat jar in `sdks/java/io/snowflake/build.gradle` that depends on both `sdks:java:expansion-service` and `sdks:java:io:snowflake`. (I'm not an expert on how the java nature creates fat jars; perhaps the simplest would be to put this in a new package `sdks/java/io/snowflake/expansion-service` whose sole contents would be exactly the same as `sdks/java/io/expansion-service/build.gradle` except depend on snowflake rather than kafka and jdbc. 




----------------------------------------------------------------
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:
users@infra.apache.org