You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by bo...@apache.org on 2023/01/27 12:36:48 UTC

[impala] branch master updated (b3e9c4a65 -> 8292e4afd)

This is an automated email from the ASF dual-hosted git repository.

boroknagyz pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git


    from b3e9c4a65 IMPALA-7969: Always admit trivial queries immediately
     new d3ece4433 IMPALA-11857: Connect join build fragment to join in graphical plan
     new 8292e4afd IMPALA-11864: Iceberg LOAD DATA should not load S3 hidden files

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 be/src/service/impala-http-handler.cc                    |  4 ++++
 .../java/org/apache/impala/analysis/LoadDataStmt.java    |  3 ++-
 .../functional-query/queries/QueryTest/iceberg-load.test | 16 +++++++++++++++-
 tests/query_test/test_iceberg.py                         |  8 ++++++++
 www/query_plan.tmpl                                      | 13 ++++++++++---
 5 files changed, 39 insertions(+), 5 deletions(-)


[impala] 01/02: IMPALA-11857: Connect join build fragment to join in graphical plan

Posted by bo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

boroknagyz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git

commit d3ece4433d2cf97ebbe4430f00dcccfdeeb25d67
Author: Kurt Deschler <kd...@cloudera.com>
AuthorDate: Mon Jan 23 18:57:37 2023 -0500

    IMPALA-11857: Connect join build fragment to join in graphical plan
    
    When support was added for join build sink, the plan JSON and plan
    rendering logic were not updated to handle the new sink type. As a
    result, the linkage from the join build fragment to its corresponding
    join node were not expressed in the JSON and build fragments nodes were
    rendered as orphaned.
    
    This change adds a new JSON join_build_target field to join build
    fragments and connects the build fragment to the join with a green dashed
    line similar to the red dashed line used for data sender fragments.
    
    Also changed the SVG fill type to 'none' for exchange edges to avoid
    rendering a black triangle if the right child was an exchange as in the
    join build case.
    
    Testing:
    - Manual testing with TPCH queries and reviewing rendered plan diagrams
    
    Change-Id: I80af977e5c5e869268d3ee68fafe541adadc239d
    Reviewed-on: http://gerrit.cloudera.org:8080/19437
    Reviewed-by: Impala Public Jenkins <im...@cloudera.com>
    Tested-by: Impala Public Jenkins <im...@cloudera.com>
---
 be/src/service/impala-http-handler.cc |  4 ++++
 www/query_plan.tmpl                   | 13 ++++++++++---
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/be/src/service/impala-http-handler.cc b/be/src/service/impala-http-handler.cc
index 1c320dfad..1bdc2411d 100644
--- a/be/src/service/impala-http-handler.cc
+++ b/be/src/service/impala-http-handler.cc
@@ -820,6 +820,10 @@ void PlanToJson(const vector<TPlanFragment>& fragments, const TExecSummary& summ
         Value target(label_map[sink.stream_sink.dest_node_id].c_str(),
             document->GetAllocator());
         plan_fragment.AddMember("data_stream_target", target, document->GetAllocator());
+      } else if (sink.__isset.join_build_sink) {
+        Value target(label_map[sink.join_build_sink.dest_node_id].c_str(),
+            document->GetAllocator());
+        plan_fragment.AddMember("join_build_target", target, document->GetAllocator());
       }
     }
     nodes.PushBack(plan_fragment, document->GetAllocator());
diff --git a/www/query_plan.tmpl b/www/query_plan.tmpl
index 744eb69d9..ed2373fcc 100644
--- a/www/query_plan.tmpl
+++ b/www/query_plan.tmpl
@@ -115,13 +115,20 @@ function build(node, parent, edges, states, colour_idx, max_node_time) {
     edges.push({ start: node["label"], end: parent,
                  style: { label: label_val }});
   }
-  // Add an inter-fragment edge. We use a red dashed line to show that rows are crossing
-  // the fragment boundary.
+  // Add an inter-fragment edges
   if (node["data_stream_target"]) {
+    // Use a red dashed line to show a streaming data boundary
     edges.push({ "start": node["label"],
                  "end": node["data_stream_target"],
                  "style": { label: "" + node["output_card"].toLocaleString(),
-                            style: "stroke: #f66; stroke-dasharray: 5, 5;"}});
+                            style: "fill:none; stroke: #c00000; stroke-dasharray: 5, 5;"}});
+  } else if (node["join_build_target"]) {
+    // Use a green dashed line to show a join build boundary
+    edges.push({ "start": node["label"],
+                 "end": node["join_build_target"],
+                 "style": { label: "" + node["output_card"].toLocaleString(),
+                            style: "fill: none; stroke: #00c000; stroke-dasharray: 5, 5;"}
+});
   }
   max_node_time = Math.max(node["max_time_val"], max_node_time)
   for (var i = 0; i < node["children"].length; ++i) {


[impala] 02/02: IMPALA-11864: Iceberg LOAD DATA should not load S3 hidden files

Posted by bo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

boroknagyz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git

commit 8292e4afdd4b6f5fcfbf2291f97c988c07e1a421
Author: Tamas Mate <tm...@apache.org>
AuthorDate: Thu Jan 26 12:32:32 2023 +0100

    IMPALA-11864: Iceberg LOAD DATA should not load S3 hidden files
    
    Loading data from S3 did not skip hidden files because the
    FileSystemUtil.listFiles() call was returning a RemoteIterator, which
    compared to RecursingIterator does not filter the hidden files. This
    would make a load fail because the hidden files likely have invalid
    magic string.
    
    This commit adds an extra condition to skip hidden files when creating
    the CREATE subquery.
    
    Testing:
     - Added E2E test
     - Ran E2E test on S3 build
    
    Change-Id: Iffd179383c2bb2529f6f9b5f8bf5cba5f3553652
    Reviewed-on: http://gerrit.cloudera.org:8080/19441
    Reviewed-by: Daniel Becker <da...@cloudera.com>
    Tested-by: Impala Public Jenkins <im...@cloudera.com>
    Reviewed-by: Noemi Pap-Takacs <np...@cloudera.com>
    Reviewed-by: Zoltan Borok-Nagy <bo...@cloudera.com>
---
 .../java/org/apache/impala/analysis/LoadDataStmt.java    |  3 ++-
 .../functional-query/queries/QueryTest/iceberg-load.test | 16 +++++++++++++++-
 tests/query_test/test_iceberg.py                         |  8 ++++++++
 3 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/fe/src/main/java/org/apache/impala/analysis/LoadDataStmt.java b/fe/src/main/java/org/apache/impala/analysis/LoadDataStmt.java
index d23d1951d..479ba9142 100644
--- a/fe/src/main/java/org/apache/impala/analysis/LoadDataStmt.java
+++ b/fe/src/main/java/org/apache/impala/analysis/LoadDataStmt.java
@@ -255,7 +255,8 @@ public class LoadDataStmt extends StatementBase {
             sourcePath, true, "");
         while (fileStatuses.hasNext()) {
           FileStatus fileStatus = fileStatuses.next();
-          if (fileStatus.isFile()) {
+          String fileName = fileStatus.getPath().getName();
+          if (fileStatus.isFile() && !FileSystemUtil.isHiddenFile(fileName)) {
             filePathForLike = fileStatus.getPath();
             break;
           }
diff --git a/testdata/workloads/functional-query/queries/QueryTest/iceberg-load.test b/testdata/workloads/functional-query/queries/QueryTest/iceberg-load.test
index c5ad08e6a..14f19d77f 100644
--- a/testdata/workloads/functional-query/queries/QueryTest/iceberg-load.test
+++ b/testdata/workloads/functional-query/queries/QueryTest/iceberg-load.test
@@ -122,7 +122,6 @@ row_regex:.*AnalysisException: Target table .* has fewer columns \(1\) than the
 ====
 ---- QUERY
 # Test 9: Partitioned Iceberg table
----- QUERY
 create table test_iceberg_load_partitioned like functional_parquet.iceberg_partitioned
 stored as iceberg;
 ====
@@ -139,4 +138,19 @@ select count(*) from test_iceberg_load_partitioned;
 1
 ---- TYPES
 BIGINT
+====
+---- QUERY
+# Test 10: hidden files should be skipped and the one data file should be loaded
+load data inpath '/tmp/$DATABASE/hidden/' into table test_iceberg_load_partitioned;
+---- RESULTS
+'Loaded 1 file(s).'
+---- TYPES
+STRING
+====
+---- QUERY
+select count(*) from test_iceberg_load_partitioned;
+---- RESULTS
+2
+---- TYPES
+BIGINT
 ====
\ No newline at end of file
diff --git a/tests/query_test/test_iceberg.py b/tests/query_test/test_iceberg.py
index 9ae75885f..0ed9a6d8f 100644
--- a/tests/query_test/test_iceberg.py
+++ b/tests/query_test/test_iceberg.py
@@ -885,6 +885,14 @@ class TestIcebergTable(IcebergTestSuite):
     DST_DIR = "/tmp/" + unique_database + "/partitioned/"
     self.filesystem_client.make_dir(DST_DIR, permission=777)
     self.filesystem_client.copy_from_local(SRC_DIR.format(file), DST_DIR)
+    # Test 10 init: hidden files
+    DST_DIR = "/tmp/" + unique_database + "/hidden/"
+    self.filesystem_client.make_dir(DST_DIR, permission=777)
+    self.filesystem_client.create_file(DST_DIR + "_hidden.1", "Test data 123")
+    self.filesystem_client.create_file(DST_DIR + "_hidden_2.1", "Test data 123")
+    self.filesystem_client.create_file(DST_DIR + ".hidden_3", "Test data 123")
+    self.filesystem_client.create_file(DST_DIR + ".hidden_4.1", "Test data 123")
+    self.filesystem_client.copy_from_local(SRC_DIR.format(file), DST_DIR)
 
     # Init test table
     create_iceberg_table_from_directory(self.client, unique_database,