| Server IP : 34.87.99.72 / Your IP : 216.73.217.31 Web Server : Apache/2.4.46 (Unix) OpenSSL/1.1.1n System : Linux zlock-bitnami-lamp-prod-v2-vm 4.19.0-16-cloud-amd64 #1 SMP Debian 4.19.181-1 (2021-03-19) x86_64 User : bitnami ( 1000) PHP Version : 7.4.18 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /lib/google-cloud-sdk/bin/bootstrapping/ |
Upload File : |
# Copyright 2017 Google Inc. All Rights Reserved.
#
"""A convenience wrapper for starting Dataflow SQL shell."""
import os
import bootstrapping
from googlecloudsdk.command_lib.util import java
from googlecloudsdk.core.updater import update_manager
# Path to the unpacked component
_COMPONENT_DIR = os.path.join('platform', 'dataflow-sql')
# Path to the directory of unpacked jars relative to the SDK root
_JAR_DIR = os.path.join(_COMPONENT_DIR, 'lib')
# The main jar in the _JAR_DIR, must be first for precedence
_MAIN_JAR = 'dataflow_sql_shell.jar'
# Name of the main class
_CLASSNAME = 'org.apache.beam.sdk.extensions.sql.jdbc.BeamSqlLine'
def main():
"""Launches the Dataflow SQL shell."""
bootstrapping.CommandStart('dataflow-sql', component_id='dataflow-sql')
bootstrapping.CheckUpdates('dataflow-sql')
update_manager.UpdateManager.EnsureInstalledAndRestart(
['dataflow-sql'], command=__file__)
java_bin = java.RequireJavaInstalled('Dataflow SQL')
bootstrapping.ExecuteJavaClass(
java_bin,
jar_dir=_JAR_DIR,
main_jar=_MAIN_JAR,
main_class=_CLASSNAME,
main_args=['-nn', 'DFSQL', '-u', 'jdbc:beam:userAgent=DataflowSQL'])
if __name__ == '__main__':
main()