Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-29985

Spark integrated Hive ---cannot read database and table in hive

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Not A Problem
    • 2.3.2
    • None
    • Spark Core, Spark Shell
    • None

    Description

      [hadoop@master bin]$ ./beeline
      Beeline version 1.21.2.3.1.4.0-315 by Apache Hive
      beeline> !connect jdbc:hive2://localhost:10016
      Connecting to jdbc:hive2://localhost:10016
      Enter username for jdbc:hive2://localhost:10016:
      Enter password for jdbc:hive2://localhost:10016:
      19/11/21 16:18:39 INFO Utils: Supplied authorities: localhost:10016
      19/11/21 16:18:39 INFO Utils: Resolved authority: localhost:10016
      19/11/21 16:18:39 INFO HiveConnection: Will try to open client transport with JDBC Uri: jdbc:hive2://localhost:10016
      Connected to: Spark SQL (version 2.3.2.3.1.4.0-315)
      Driver: Hive JDBC (version 1.21.2.3.1.4.0-315)
      Transaction isolation: TRANSACTION_REPEATABLE_READ
      0: jdbc:hive2://localhost:10016> use default;
      ---------+

      Result

      ---------+
      ---------+
      No rows selected (0.154 seconds)
      0: jdbc:hive2://localhost:10016> show tables;
      ---------------------------------+

      database tableName isTemporary

      ---------------------------------+
      ---------------------------------+
      No rows selected (0.048 seconds)
      0: jdbc:hive2://localhost:10016> use test;
      Error: org.apache.spark.sql.catalyst.analysis.NoSuchDatabaseException: Database 'test' not found; (state=,code=0)
      0: jdbc:hive2://localhost:10016> show databases;
      ---------------+

      databaseName

      ---------------+

      default

      ---------------+
      1 row selected (0.031 seconds)

      Attachments

        Activity

          People

            Unassigned Unassigned
            oceanhaiyang lv haiyang
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: