hive-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hive QA (Jira)" <>
Subject [jira] [Commented] (HIVE-23123) Disable export/import of views and materialized views
Date Tue, 07 Apr 2020 21:50:00 GMT


Hive QA commented on HIVE-23123:

Here are the results of testing the latest attachment:

{color:green}SUCCESS:{color} +1 due to 2 test(s) being added or modified.

{color:green}SUCCESS:{color} +1 due to 18197 tests passed

Test results:
Console output:
Test logs:

Executing org.apache.hive.ptest.execution.TestCheckPhase
Executing org.apache.hive.ptest.execution.PrepPhase
Executing org.apache.hive.ptest.execution.YetusPhase
Executing org.apache.hive.ptest.execution.ExecutionPhase
Executing org.apache.hive.ptest.execution.ReportingPhase

This message is automatically generated.

ATTACHMENT ID: 12999213 - PreCommit-HIVE-Build

> Disable export/import of views and materialized views
> -----------------------------------------------------
>                 Key: HIVE-23123
>                 URL:
>             Project: Hive
>          Issue Type: Bug
>          Components: Hive
>            Reporter: Miklos Gergely
>            Assignee: Miklos Gergely
>            Priority: Major
>              Labels: pull-request-available
>         Attachments: HIVE-23123.01.patch, HIVE-23123.02.patch
>          Time Spent: 10m
>  Remaining Estimate: 0h
> According to []
import and export can be done by using the
> {code:java}
> export table ...
> import table ... 
> {code}
> commands. The document doesn't mention views or materialized views at all, and in fact
we don't support commands like
> {code:java}
> export view ...
> import view ...
> export materialized view ...
> import materialized view ... 
> {code}
> they can not be parsed at all. The word table is often used though in a broader sense,
when it means all table like entities, including views and materialized views. For example
the various Table classes may represent any of these as well.
> If I try to export a view with the export table ... command, it goes fine. A _metadata
file will be created, but no data directory, which is what we'd expect. If I try to import
it back, an exception is thrown due to the lack of the data dir:
> {code:java}
> java.lang.AssertionError: null==getPath() for exim_view
>  at org.apache.hadoop.hive.ql.metadata.Hive.loadTable(
>  at org.apache.hadoop.hive.ql.exec.MoveTask.execute(
>  at org.apache.hadoop.hive.ql.exec.Task.executeTask(
>  at org.apache.hadoop.hive.ql.exec.TaskRunner.runSequential(
>  at org.apache.hadoop.hive.ql.Executor.launchTask(
>  at org.apache.hadoop.hive.ql.Executor.launchTasks(
>  at org.apache.hadoop.hive.ql.Executor.runTasks(
>  at org.apache.hadoop.hive.ql.Executor.execute(
>  at org.apache.hadoop.hive.ql.Driver.runInternal(
>  at
>  at 
> {code}
> Still the view gets imported successfully, as data movement wasn't even necessary.
> If we try to export a materialized view which is transactional, then this exception occurs:
> {code:java}
> org.apache.hadoop.hive.ql.parse.SemanticException: org.apache.hadoop.hive.ql.metadata.InvalidTableException:
Table not found exim_materialized_view_da21d41a_9fe4_4446_9c72_d251496abf9d
>  at org.apache.hadoop.hive.ql.parse.AcidExportSemanticAnalyzer.analyzeAcidExport(
>  at org.apache.hadoop.hive.ql.parse.AcidExportSemanticAnalyzer.analyze(
>  at org.apache.hadoop.hive.ql.parse.RewriteSemanticAnalyzer.analyzeInternal(
>  at org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer.analyze(
>  at org.apache.hadoop.hive.ql.Compiler.analyze(
>  at org.apache.hadoop.hive.ql.Compiler.compile(
>  at org.apache.hadoop.hive.ql.Driver.compile(
>  at org.apache.hadoop.hive.ql.Driver.compileInternal(
>  at org.apache.hadoop.hive.ql.Driver.compileAndRespond(
>  at org.apache.hadoop.hive.ql.Driver.compileAndRespond( 
> {code}
> So the export process can not handle it, as the temporary table is not getting created.
> The import command handling have a lot of codes dedicated to importing views and materialized
views, which suggests that we support the importing (and thus also suggests implicitly that
we support the exporting) of views and materialiezed views.
> So the conclusion is that we have to decide if we support exporting/importing of views
and materialized views.
> If we decide not to support them then:
>  - export process should throw an exception if a view or materialized view is the subject
>  - the codes specific to view imports should be removed
> If we decide to support them, then:
>  - the commands mentioned above above should be introduced
>  - exception should be thrown if not the proper command used (e.g. export view on a table)
>  - the exceptions mentioned above should be fixed
> I prefer not to support them, I don't think we should support the exporting / importing
of views. The point of exporting / importing is the transfer of data, not DDL, it causes more
issues than it solves. Our current documentation also suggests that it is only supported for

This message was sent by Atlassian Jira

View raw message