Uploaded image for project: 'IMPALA'
  1. IMPALA
  2. IMPALA-4056

toSql() of DistributeParam doesn't work as expected

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: Kudu_Impala, Impala 2.7.0
    • Fix Version/s: Impala 2.8.0
    • Component/s: Frontend
    • Labels:
    • Environment:
      CentOS 6.7

      Description

      Originally toSql() of DistributeParam wouldn't print any split rows for type range. As code below shows:

      public String toSql() {
          if (num_buckets_ == NO_BUCKETS) {
            StringBuilder builder = new StringBuilder();
            for (ArrayList<LiteralExpr> splitRow : splitRows_) {
              splitRowToString(splitRow);
            }
            return String.format("RANGE(%s) INTO RANGES(%s)", Joiner.on(", ").join(columns_),
                builder.toString());
          } else {
            return String.format("HASH(%s) INTO %d BUCKETS", Joiner.on(", ").join(columns_),
                num_buckets_);
          }
        }
      

      We didn't append the return string of splitRowToString() to builder, so builder.toString() wouldn't print anything.

        Activity

        Hide
        yhluo_impala_39a4 Yuanhao Luo added a comment -

        I have push a commit to https://gerrit.cloudera.org/#/c/4195/, thanks for doing a review.

        Show
        yhluo_impala_39a4 Yuanhao Luo added a comment - I have push a commit to https://gerrit.cloudera.org/#/c/4195/ , thanks for doing a review.
        Hide
        alex.behm Alexander Behm added a comment -

        Thanks for filing and working on it!

        Show
        alex.behm Alexander Behm added a comment - Thanks for filing and working on it!
        Hide
        yhluo_impala_39a4 Yuanhao Luo added a comment -

        commit 052d3cc8dd893f2225accacde3c917aac0c1cfcd
        Author: Yuanhao Luo <luoyuanhao@software.ict.ac.cn>
        Date: Thu Sep 1 22:17:55 2016 +0800

        IMPALA-4056: Fix toSql() of DistributeParam

        This commit fixes two issues in toSql() of DistributeParam:
        1. string literals were not quoted
        2. range partition split rows were not printed.
        Besides, this commit fixes a small issue in run-hive-server.sh

        Change-Id: I984a63a24f02670347b0e1efceb864d265d1f931
        Reviewed-on: http://gerrit.cloudera.org:8080/4195
        Reviewed-by: Matthew Jacobs <mj@cloudera.com>
        Reviewed-by: Alex Behm <alex.behm@cloudera.com>
        Tested-by: Internal Jenkins

        Show
        yhluo_impala_39a4 Yuanhao Luo added a comment - commit 052d3cc8dd893f2225accacde3c917aac0c1cfcd Author: Yuanhao Luo <luoyuanhao@software.ict.ac.cn> Date: Thu Sep 1 22:17:55 2016 +0800 IMPALA-4056 : Fix toSql() of DistributeParam This commit fixes two issues in toSql() of DistributeParam: 1. string literals were not quoted 2. range partition split rows were not printed. Besides, this commit fixes a small issue in run-hive-server.sh Change-Id: I984a63a24f02670347b0e1efceb864d265d1f931 Reviewed-on: http://gerrit.cloudera.org:8080/4195 Reviewed-by: Matthew Jacobs <mj@cloudera.com> Reviewed-by: Alex Behm <alex.behm@cloudera.com> Tested-by: Internal Jenkins

          People

          • Assignee:
            yhluo_impala_39a4 Yuanhao Luo
            Reporter:
            yhluo_impala_39a4 Yuanhao Luo
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development