Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-22325

variable expansion doesn't work in beeline-site.xml

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 3.1.0, 3.1.1, 3.1.2
    • 4.0.0-alpha-2
    • Beeline
    • None

    Description

      I have a default jdbc connection string and I want to build on top on it to have customized connections like setting custom queue names.

      $ cat .beeline/beeline-site.xml
        <configuration  xmlns:xi="http://www.w3.org/2001/XInclude">
      
          <property>
            <name>beeline.hs2.jdbc.url.base</name>
            <value>jdbc:hive2://localhost/</value>
          </property>
      
          <property>
            <name>beeline.hs2.jdbc.url.myqueue</name>
            <value>${beeline.hs2.jdbc.url.base}?tez.queue.name=myqueue</value>
          </property>
        </configuration>
      $ beeline -c myqueue
      SLF4J: Class path contains multiple SLF4J bindings.
      SLF4J: Found binding in [jar:file:/usr/hdp/3.1.0.0-78/hive/lib/log4j-slf4j-impl-2.10.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
      SLF4J: Found binding in [jar:file:/usr/hdp/3.1.0.0-78/hadoop/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
      SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
      SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
      Error in parsing jdbc url: ${beeline.hs2.jdbc.url.base}?tez.queue.name=myqueue from beeline-site.xml
      Beeline version 3.1.0.3.1.0.0-78 by Apache Hive
      beeline>
      

      Relevant code is found in https://github.com/apache/hive/blob/master/beeline/src/java/org/apache/hive/beeline/hs2connection/BeelineSiteParser.java#L94

      Entry<T,T>#getValue() skips the variable expansion . Using Configuration#get(key) would make this work.

      Attachments

        1. HIVE-22325.patch.txt
          4 kB
          Allan Espinosa
        2. HIVE-22325.1.patch
          5 kB
          Allan Espinosa

        Issue Links

          Activity

            People

              aespinosa Allan Espinosa
              aespinosa Allan Espinosa
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: