Quellcode durchsuchen

[notebook] Add an example of jdbc snippet in the ini

Romain Rigaux vor 10 Jahren
Ursprung
Commit
9eda820

+ 30 - 20
desktop/conf.dist/hue.ini

@@ -531,47 +531,57 @@
 
 [notebook]
 
+  # One entry for each type of snippet. The first 5 will appear in the wheel.
   [[interpreters]]
+    # Define the name and how to connect and execute the language.
 
     [[[hive]]]
-    name=Hive
-    interface=hiveserver2
+      # The name of the snippet.
+      name=Hive
+      # The backend connection to use to communicate with the server.
+      interface=hiveserver2
 
     [[[impala]]]
-    name=Impala
-    interface=hiveserver2
+      name=Impala
+      interface=hiveserver2
 
     [[[spark]]]
-    name=Scala
-    interface=livy
+      name=Scala
+      interface=livy
 
     [[[pyspark]]]
-    name=PySpark
-    interface=livy
+      name=PySpark
+      interface=livy
 
     [[[r]]]
-    name=R
-    interface=livy
+      name=R
+      interface=livy
 
     [[[jar]]]
-    name=Spark Submit Jar
-    interface=livy-batch
+      name=Spark Submit Jar
+      interface=livy-batch
 
     [[[py]]]
-    name=Spark Submit Python
-    interface=livy-batch
+      name=Spark Submit Python
+      interface=livy-batch
 
     [[[pig]]]
-    name=Pig
-    interface=pig
+      name=Pig
+      interface=pig
 
     [[[text]]]
-    name=Text
-    interface=text
+      name=Text
+      interface=text
 
     # [[[sparksql]]]
-    # name=SparkSql
-    # interface=hiveserver2
+    #   name=SparkSql
+    #   interface=hiveserver2
+
+    # [[[mysql]]]
+    #   name=MySql JDBC
+    #   interface=jdbc
+    #   ## Specific options for connecting to the server.
+    #   options='{"url": "jdbc:mysql://localhost:3306/hue", "driver": "com.mysql.jdbc.Driver", "user": "root", "password": "root"}'
 
 
 ###########################################################################

+ 30 - 20
desktop/conf/pseudo-distributed.ini.tmpl

@@ -535,47 +535,57 @@
 
 [notebook]
 
+  # One entry for each type of snippet. The first 5 will appear in the wheel.
   [[interpreters]]
+    # Define the name and how to connect and execute the language.
 
     [[[hive]]]
-    name=Hive
-    interface=hiveserver2
+      # The name of the snippet.
+      name=Hive
+      # The backend connection to use to communicate with the server.
+      interface=hiveserver2
 
     [[[impala]]]
-    name=Impala
-    interface=hiveserver2
+      name=Impala
+      interface=hiveserver2
 
     [[[spark]]]
-    name=Scala
-    interface=livy
+      name=Scala
+      interface=livy
 
     [[[pyspark]]]
-    name=PySpark
-    interface=livy
+      name=PySpark
+      interface=livy
 
     [[[r]]]
-    name=R
-    interface=livy
+      name=R
+      interface=livy
 
     [[[jar]]]
-    name=Spark Submit Jar
-    interface=livy-batch
+      name=Spark Submit Jar
+      interface=livy-batch
 
     [[[py]]]
-    name=Spark Submit Python
-    interface=livy-batch
+      name=Spark Submit Python
+      interface=livy-batch
 
     [[[pig]]]
-    name=Pig
-    interface=pig
+      name=Pig
+      interface=pig
 
     [[[text]]]
-    name=Text
-    interface=text
+      name=Text
+      interface=text
 
     # [[[sparksql]]]
-    # name=SparkSql
-    # interface=hiveserver2
+    #   name=SparkSql
+    #   interface=hiveserver2
+
+    # [[[mysql]]]
+    #   name=MySql JDBC
+    #   interface=jdbc
+    #   ## Specific options for connecting to the server.
+    #   options='{"url": "jdbc:mysql://localhost:3306/hue", "driver": "com.mysql.jdbc.Driver", "user": "root", "password": "root"}'
 
 
 ###########################################################################

+ 5 - 5
desktop/libs/notebook/src/notebook/conf.py

@@ -33,25 +33,25 @@ def get_interpreters():
 
 INTERPRETERS = UnspecifiedConfigSection(
   "interpreters",
-  help="One entry for each type of snippet",
+  help="One entry for each type of snippet. The first 5 will appear in the wheel.",
   each=ConfigSection(
-    help=_t("Define the name and how to execute the language"),
+    help=_t("Define the name and how to connect and execute the language."),
     members=dict(
       NAME=Config(
           "name",
-          help=_t("Nice name"),
+          help=_t("The name of the snippet."),
           default="SQL",
           type=str,
       ),
       INTERFACE=Config(
           "interface",
-          help="The backend connection to use to communicate with the server",
+          help="The backend connection to use to communicate with the server.",
           default="hiveserver2",
           type=str,
       ),
       OPTIONS=Config(
         key='options',
-        help=_t('Database options to specify the server for connecting.'),
+        help=_t('Specific options for connecting to the server.'),
         type=coerce_json_dict,
         default='{}'
       )