Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-13526

Switching to a non existing catalog or database crashes sql-client

    XMLWordPrintableJSON

Details

    Description

      sql-client crashes if user tries to switch to a non-existing DB:

      Exception in thread "main" org.apache.flink.table.client.SqlClientException: Unexpected exception. This is a bug. Please consider filing an issue.
      	at org.apache.flink.table.client.SqlClient.main(SqlClient.java:206)
      Caused by: org.apache.flink.table.catalog.exceptions.CatalogException: A database with name [foo] does not exist in the catalog: [myhive].
      	at org.apache.flink.table.catalog.CatalogManager.setCurrentDatabase(CatalogManager.java:286)
      	at org.apache.flink.table.api.internal.TableEnvironmentImpl.useDatabase(TableEnvironmentImpl.java:398)
      	at org.apache.flink.table.client.gateway.local.LocalExecutor.lambda$useDatabase$5(LocalExecutor.java:258)
      	at org.apache.flink.table.client.gateway.local.ExecutionContext.wrapClassLoader(ExecutionContext.java:216)
      	at org.apache.flink.table.client.gateway.local.LocalExecutor.useDatabase(LocalExecutor.java:256)
      	at org.apache.flink.table.client.cli.CliClient.callUseDatabase(CliClient.java:434)
      	at org.apache.flink.table.client.cli.CliClient.callCommand(CliClient.java:282)
      	at java.util.Optional.ifPresent(Optional.java:159)
      	at org.apache.flink.table.client.cli.CliClient.open(CliClient.java:200)
      	at org.apache.flink.table.client.SqlClient.openCli(SqlClient.java:123)
      	at org.apache.flink.table.client.SqlClient.start(SqlClient.java:105)
      	at org.apache.flink.table.client.SqlClient.main(SqlClient.java:194)
      

      Attachments

        Issue Links

          Activity

            People

              lirui Rui Li
              lirui Rui Li
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m