Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPARK-40398][CORE][SQL] Use Loop instead of Arrays.stream api #37843

Closed
wants to merge 18 commits into from

Conversation

LuciferYang
Copy link
Contributor

@LuciferYang LuciferYang commented Sep 9, 2022

What changes were proposed in this pull request?

This PR replaces Arrays.stream api with loop where performance improvement can be obtained.

Why are the changes needed?

Minor performance improvement.

Does this PR introduce any user-facing change?

No

How was this patch tested?

Pass Github actions

@LuciferYang LuciferYang changed the title [SPARK-40398][SQL] Use Loop instead of Arrays.stream api [WIP][SPARK-40398][SQL] Use Loop instead of Arrays.stream api Sep 9, 2022
@LuciferYang LuciferYang marked this pull request as draft September 9, 2022 05:52
@github-actions github-actions bot added the SQL label Sep 9, 2022
@LuciferYang
Copy link
Contributor Author

will add more similar case

Copy link
Member

@srowen srowen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks OK; see if there are more very similar cases. Do you have any rough benchmarks that show it's faster?

Copy link
Member

@srowen srowen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, yeah

@LuciferYang
Copy link
Contributor Author

Yes, there are other cases. I am sorting out the test data and hope to fix them all in this one

@@ -44,7 +44,16 @@ public interface Expression {
* List of fields or columns that are referenced by this expression.
*/
default NamedReference[] references() {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Compare

public static TestValue[] distinctUseStreamApi(TestObj[] input) {
      return Arrays.stream(input).map(s -> s.values)
        .flatMap(Arrays::stream).distinct().toArray(TestValue[]::new);
    }

and

 public static TestValue[] distinctUseLoopApi(TestObj[] input) {
        List<TestValue> list = new ArrayList<>();
        Set<TestValue> uniqueValues = new HashSet<>();
        for (TestObj s : input) {
            TestValue[] values = s.values;
            for (TestValue testValue : values) {
                if (uniqueValues.add(testValue)) {
                    list.add(testValue);
                }
            }
        }
        return list.toArray(new TestValue[0]);
    }

TestValue and TestObj define as follows:

public static class TestObj {
        TestValue[] values;

        public TestObj(int size, int range) {
            values = new TestValue[size];
            for (int i = 0; i < values.length; i++) {
                values[i] = new TestValue(RandomUtils.nextInt(0, range));
            }
        }
    }

    public static class TestValue {
        private int value;

        public TestValue(int value) {
            this.value = value;
        }

        @Override
        public boolean equals(Object o) {
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;
            TestValue testValue = (TestValue) o;
            return value == testValue.value;
        }

        @Override
        public int hashCode() {
            return Objects.hashCode(value);
        }
    }

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use following method build test object

 public static TestObj[] objs(int length, int size, int range) {
        TestObj[] objects = new TestObj[length];
        for (int i = 0; i < length; i++) {
            objects[i] = new TestObj(size, range);
        }
        return objects;
    }

and test length, size, range:

-1, 5, 100

  • 5, 5, 100
  • 10, 5, 100
  • 20, 5, 100
  • 50, 5, 100
  • 100, 5, 100
  • 500, 5, 100
  • 1000, 5, 100

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Java 8

OpenJDK 64-Bit Server VM 1.8.0_345-b01 on Linux 5.15.0-1019-azure
Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz
Test for distinct with input size 1:      Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
------------------------------------------------------------------------------------------------------------------------
Use Arrays.steam api                                 35             35           1          2.8         351.9       1.0X
Use Loop api                                         18             18           0          5.5         180.6       1.9X

OpenJDK 64-Bit Server VM 1.8.0_345-b01 on Linux 5.15.0-1019-azure
Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz
Test for distinct with input size 5:      Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
------------------------------------------------------------------------------------------------------------------------
Use Arrays.steam api                                129            130           1          0.8        1288.7       1.0X
Use Loop api                                         82             83           1          1.2         824.4       1.6X

OpenJDK 64-Bit Server VM 1.8.0_345-b01 on Linux 5.15.0-1019-azure
Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz
Test for distinct with input size 10:     Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
------------------------------------------------------------------------------------------------------------------------
Use Arrays.steam api                                228            229           1          0.4        2280.0       1.0X
Use Loop api                                        160            161           1          0.6        1599.7       1.4X

OpenJDK 64-Bit Server VM 1.8.0_345-b01 on Linux 5.15.0-1019-azure
Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz
Test for distinct with input size 20:     Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
------------------------------------------------------------------------------------------------------------------------
Use Arrays.steam api                                430            431           1          0.2        4301.0       1.0X
Use Loop api                                        311            312           1          0.3        3109.9       1.4X

OpenJDK 64-Bit Server VM 1.8.0_345-b01 on Linux 5.15.0-1019-azure
Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz
Test for distinct with input size 50:     Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
------------------------------------------------------------------------------------------------------------------------
Use Arrays.steam api                                860            862           2          0.1        8597.6       1.0X
Use Loop api                                        701            702           1          0.1        7013.1       1.2X

OpenJDK 64-Bit Server VM 1.8.0_345-b01 on Linux 5.15.0-1019-azure
Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz
Test for distinct with input size 100:    Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
------------------------------------------------------------------------------------------------------------------------
Use Arrays.steam api                               1454           1456           3          0.1       14540.1       1.0X
Use Loop api                                       1317           1318           2          0.1       13168.9       1.1X

OpenJDK 64-Bit Server VM 1.8.0_345-b01 on Linux 5.15.0-1019-azure
Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz
Test for distinct with input size 500:    Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
------------------------------------------------------------------------------------------------------------------------
Use Arrays.steam api                               5584           5586           2          0.0       55841.2       1.0X
Use Loop api                                       5784           5786           3          0.0       57839.1       1.0X

OpenJDK 64-Bit Server VM 1.8.0_345-b01 on Linux 5.15.0-1019-azure
Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz
Test for distinct with input size 1000:   Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
------------------------------------------------------------------------------------------------------------------------
Use Arrays.steam api                              10727          10728           2          0.0      107266.4       1.0X
Use Loop api                                      10534          10535           1          0.0      105342.5       1.0X

Java 11

OpenJDK 64-Bit Server VM 11.0.16+8-LTS on Linux 5.15.0-1019-azure
Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz
Test for distinct with input size 1:      Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
------------------------------------------------------------------------------------------------------------------------
Use Arrays.steam api                                 41             42           1          2.4         408.5       1.0X
Use Loop api                                         22             23           1          4.5         224.4       1.8X

OpenJDK 64-Bit Server VM 11.0.16+8-LTS on Linux 5.15.0-1019-azure
Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz
Test for distinct with input size 5:      Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
------------------------------------------------------------------------------------------------------------------------
Use Arrays.steam api                                159            160           1          0.6        1594.5       1.0X
Use Loop api                                         86             87           0          1.2         864.7       1.8X

OpenJDK 64-Bit Server VM 11.0.16+8-LTS on Linux 5.15.0-1019-azure
Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz
Test for distinct with input size 10:     Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
------------------------------------------------------------------------------------------------------------------------
Use Arrays.steam api                                275            276           2          0.4        2748.0       1.0X
Use Loop api                                        167            169           3          0.6        1673.5       1.6X

OpenJDK 64-Bit Server VM 11.0.16+8-LTS on Linux 5.15.0-1019-azure
Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz
Test for distinct with input size 20:     Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
------------------------------------------------------------------------------------------------------------------------
Use Arrays.steam api                                511            513           2          0.2        5113.5       1.0X
Use Loop api                                        315            317           2          0.3        3151.8       1.6X

OpenJDK 64-Bit Server VM 11.0.16+8-LTS on Linux 5.15.0-1019-azure
Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz
Test for distinct with input size 50:     Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
------------------------------------------------------------------------------------------------------------------------
Use Arrays.steam api                               1012           1014           2          0.1       10118.2       1.0X
Use Loop api                                        675            677           2          0.1        6747.0       1.5X

OpenJDK 64-Bit Server VM 11.0.16+8-LTS on Linux 5.15.0-1019-azure
Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz
Test for distinct with input size 100:    Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
------------------------------------------------------------------------------------------------------------------------
Use Arrays.steam api                               1665           1667           3          0.1       16645.2       1.0X
Use Loop api                                       1253           1254           1          0.1       12528.3       1.3X

OpenJDK 64-Bit Server VM 11.0.16+8-LTS on Linux 5.15.0-1019-azure
Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz
Test for distinct with input size 500:    Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
------------------------------------------------------------------------------------------------------------------------
Use Arrays.steam api                               6305           6308           5          0.0       63046.3       1.0X
Use Loop api                                       5375           5376           1          0.0       53751.0       1.2X

OpenJDK 64-Bit Server VM 11.0.16+8-LTS on Linux 5.15.0-1019-azure
Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz
Test for distinct with input size 1000:   Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
------------------------------------------------------------------------------------------------------------------------
Use Arrays.steam api                              12081          12083           3          0.0      120806.6       1.0X
Use Loop api                                      10463          10467           5          0.0      104634.7       1.2X

Java 17

OpenJDK 64-Bit Server VM 17.0.4+8-LTS on Linux 5.15.0-1019-azure
Intel(R) Xeon(R) CPU E5-2673 v4 @ 2.30GHz
Test for distinct with input size 1:      Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
------------------------------------------------------------------------------------------------------------------------
Use Arrays.steam api                                 33             36           2          3.1         325.2       1.0X
Use Loop api                                         16             18           2          6.1         164.4       2.0X

OpenJDK 64-Bit Server VM 17.0.4+8-LTS on Linux 5.15.0-1019-azure
Intel(R) Xeon(R) CPU E5-2673 v4 @ 2.30GHz
Test for distinct with input size 5:      Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
------------------------------------------------------------------------------------------------------------------------
Use Arrays.steam api                                103            111           5          1.0        1032.9       1.0X
Use Loop api                                         75             80           3          1.3         746.4       1.4X

OpenJDK 64-Bit Server VM 17.0.4+8-LTS on Linux 5.15.0-1019-azure
Intel(R) Xeon(R) CPU E5-2673 v4 @ 2.30GHz
Test for distinct with input size 10:     Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
------------------------------------------------------------------------------------------------------------------------
Use Arrays.steam api                                202            210           5          0.5        2022.3       1.0X
Use Loop api                                        152            164           8          0.7        1522.6       1.3X

OpenJDK 64-Bit Server VM 17.0.4+8-LTS on Linux 5.15.0-1019-azure
Intel(R) Xeon(R) CPU E5-2673 v4 @ 2.30GHz
Test for distinct with input size 20:     Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
------------------------------------------------------------------------------------------------------------------------
Use Arrays.steam api                                345            362          14          0.3        3446.2       1.0X
Use Loop api                                        283            299          15          0.4        2827.3       1.2X

OpenJDK 64-Bit Server VM 17.0.4+8-LTS on Linux 5.15.0-1019-azure
Intel(R) Xeon(R) CPU E5-2673 v4 @ 2.30GHz
Test for distinct with input size 50:     Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
------------------------------------------------------------------------------------------------------------------------
Use Arrays.steam api                                729            767          33          0.1        7295.0       1.0X
Use Loop api                                        581            598          12          0.2        5811.8       1.3X

OpenJDK 64-Bit Server VM 17.0.4+8-LTS on Linux 5.15.0-1019-azure
Intel(R) Xeon(R) CPU E5-2673 v4 @ 2.30GHz
Test for distinct with input size 100:    Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
------------------------------------------------------------------------------------------------------------------------
Use Arrays.steam api                               1370           1381          16          0.1       13700.8       1.0X
Use Loop api                                       1107           1114          10          0.1       11070.0       1.2X

OpenJDK 64-Bit Server VM 17.0.4+8-LTS on Linux 5.15.0-1019-azure
Intel(R) Xeon(R) CPU E5-2673 v4 @ 2.30GHz
Test for distinct with input size 500:    Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
------------------------------------------------------------------------------------------------------------------------
Use Arrays.steam api                               6541           6545           7          0.0       65405.0       1.0X
Use Loop api                                       4694           4782         124          0.0       46939.4       1.4X

OpenJDK 64-Bit Server VM 17.0.4+8-LTS on Linux 5.15.0-1019-azure
Intel(R) Xeon(R) CPU E5-2673 v4 @ 2.30GHz
Test for distinct with input size 1000:   Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
------------------------------------------------------------------------------------------------------------------------
Use Arrays.steam api                              11999          12185         263          0.0      119990.3       1.0X
Use Loop api                                       9282           9366         118          0.0       92822.1       1.3X

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For Java 11 and 17, using loop looks more better,

@github-actions github-actions bot added the CORE label Sep 10, 2022
@LuciferYang
Copy link
Contributor Author

LuciferYang commented Sep 10, 2022

private byte[] getTranscript(AuthMessage... encryptedPublicKeys) {
ByteBuf transcript = Unpooled.buffer(
Arrays.stream(encryptedPublicKeys).mapToInt(k -> k.encodedLength()).sum());
Arrays.stream(encryptedPublicKeys).forEachOrdered(k -> k.encode(transcript));
return transcript.array();
}

Test mapToIntAndSum

public static int authMessagesLengthUseStreamApi(AuthMessage[] encryptedPublicKeys) {
      return Arrays.stream(encryptedPublicKeys).mapToInt(k -> k.encodedLength()).sum();
    }

vs

 public static int authMessagesLengthUseLoopApi(AuthMessage[] encryptedPublicKeys) {
      int initialCapacity = 0;
      for (AuthMessage k : encryptedPublicKeys) {
        initialCapacity += k.encodedLength();
      }
      return initialCapacity;
    }

with AuthMessage[] size 1, 5, 10, 20, 50, 100, 500, 1000

Java 8

OpenJDK 64-Bit Server VM 1.8.0_345-b01 on Linux 5.15.0-1019-azure
Intel(R) Xeon(R) CPU E5-2673 v4 @ 2.30GHz
Test AuthMessage length with input size 1:  Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
-------------------------------------------------------------------------------------------------------------------------
Use Arrays.steam api                                  24             28           2          4.1         241.4       1.0X
Use Loop api                                          17             21           2          6.0         167.9       1.4X

OpenJDK 64-Bit Server VM 1.8.0_345-b01 on Linux 5.15.0-1019-azure
Intel(R) Xeon(R) CPU E5-2673 v4 @ 2.30GHz
Test AuthMessage length with input size 5:  Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
-------------------------------------------------------------------------------------------------------------------------
Use Arrays.steam api                                  87             97           4          1.1         874.7       1.0X
Use Loop api                                          82             91           4          1.2         819.7       1.1X

OpenJDK 64-Bit Server VM 1.8.0_345-b01 on Linux 5.15.0-1019-azure
Intel(R) Xeon(R) CPU E5-2673 v4 @ 2.30GHz
Test AuthMessage length with input size 10:  Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
--------------------------------------------------------------------------------------------------------------------------
Use Arrays.steam api                                  174            184           6          0.6        1742.0       1.0X
Use Loop api                                          170            185          11          0.6        1698.9       1.0X

OpenJDK 64-Bit Server VM 1.8.0_345-b01 on Linux 5.15.0-1019-azure
Intel(R) Xeon(R) CPU E5-2673 v4 @ 2.30GHz
Test AuthMessage length with input size 20:  Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
--------------------------------------------------------------------------------------------------------------------------
Use Arrays.steam api                                  362            376          11          0.3        3615.6       1.0X
Use Loop api                                          349            364          20          0.3        3486.3       1.0X

OpenJDK 64-Bit Server VM 1.8.0_345-b01 on Linux 5.15.0-1019-azure
Intel(R) Xeon(R) CPU E5-2673 v4 @ 2.30GHz
Test AuthMessage length with input size 50:  Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
--------------------------------------------------------------------------------------------------------------------------
Use Arrays.steam api                                  892            916          30          0.1        8918.2       1.0X
Use Loop api                                          845            865          34          0.1        8450.6       1.1X

OpenJDK 64-Bit Server VM 1.8.0_345-b01 on Linux 5.15.0-1019-azure
Intel(R) Xeon(R) CPU E5-2673 v4 @ 2.30GHz
Test AuthMessage length with input size 100:  Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
---------------------------------------------------------------------------------------------------------------------------
Use Arrays.steam api                                  1754           1767          19          0.1       17535.4       1.0X
Use Loop api                                          1686           1708          31          0.1       16860.7       1.0X

OpenJDK 64-Bit Server VM 1.8.0_345-b01 on Linux 5.15.0-1019-azure
Intel(R) Xeon(R) CPU E5-2673 v4 @ 2.30GHz
Test AuthMessage length with input size 500:  Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
---------------------------------------------------------------------------------------------------------------------------
Use Arrays.steam api                                  8690           8749          84          0.0       86899.4       1.0X
Use Loop api                                          8726           8792          94          0.0       87259.0       1.0X


OpenJDK 64-Bit Server VM 1.8.0_345-b01 on Linux 5.15.0-1019-azure
Intel(R) Xeon(R) CPU E5-2673 v4 @ 2.30GHz
Test AuthMessage length with input size 1000:  Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
----------------------------------------------------------------------------------------------------------------------------
Use Arrays.steam api                                  17733          17815         116          0.0      177334.2       1.0X
Use Loop api                                          17260          17294          48          0.0      172603.4       1.0X

Java 11

OpenJDK 64-Bit Server VM 11.0.16+8-LTS on Linux 5.15.0-1019-azure
Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz
Test AuthMessage length with input size 1:  Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
-------------------------------------------------------------------------------------------------------------------------
Use Arrays.steam api                                  18             19           1          5.5         180.3       1.0X
Use Loop api                                          13             13           0          7.6         131.8       1.4X

OpenJDK 64-Bit Server VM 11.0.16+8-LTS on Linux 5.15.0-1019-azure
Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz
Test AuthMessage length with input size 5:  Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
-------------------------------------------------------------------------------------------------------------------------
Use Arrays.steam api                                  77             79           1          1.3         774.6       1.0X
Use Loop api                                          63             64           2          1.6         631.9       1.2X

OpenJDK 64-Bit Server VM 11.0.16+8-LTS on Linux 5.15.0-1019-azure
Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz
Test AuthMessage length with input size 10:  Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
--------------------------------------------------------------------------------------------------------------------------
Use Arrays.steam api                                  140            140           0          0.7        1395.8       1.0X
Use Loop api                                          124            126           1          0.8        1243.8       1.1X

OpenJDK 64-Bit Server VM 11.0.16+8-LTS on Linux 5.15.0-1019-azure
Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz
Test AuthMessage length with input size 20:  Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
--------------------------------------------------------------------------------------------------------------------------
Use Arrays.steam api                                  264            267           5          0.4        2635.8       1.0X
Use Loop api                                          246            251           5          0.4        2463.6       1.1X

OpenJDK 64-Bit Server VM 11.0.16+8-LTS on Linux 5.15.0-1019-azure
Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz
Test AuthMessage length with input size 50:  Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
--------------------------------------------------------------------------------------------------------------------------
Use Arrays.steam api                                  636            636           1          0.2        6357.8       1.0X
Use Loop api                                          611            613           2          0.2        6112.3       1.0X

OpenJDK 64-Bit Server VM 11.0.16+8-LTS on Linux 5.15.0-1019-azure
Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz
Test AuthMessage length with input size 100:  Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
---------------------------------------------------------------------------------------------------------------------------
Use Arrays.steam api                                  1257           1259           4          0.1       12566.1       1.0X
Use Loop api                                          1221           1222           1          0.1       12213.5       1.0X

OpenJDK 64-Bit Server VM 11.0.16+8-LTS on Linux 5.15.0-1019-azure
Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz
Test AuthMessage length with input size 500:  Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
---------------------------------------------------------------------------------------------------------------------------
Use Arrays.steam api                                  6245           6250           7          0.0       62452.7       1.0X
Use Loop api                                          6129           6135           9          0.0       61285.5       1.0X

OpenJDK 64-Bit Server VM 11.0.16+8-LTS on Linux 5.15.0-1019-azure
Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz
Test AuthMessage length with input size 1000:  Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
----------------------------------------------------------------------------------------------------------------------------
Use Arrays.steam api                                  12417          12437          28          0.0      124165.2       1.0X
Use Loop api                                          12275          12297          32          0.0      122745.3       1.0X

Java 17

OpenJDK 64-Bit Server VM 17.0.4+8-LTS on Linux 5.15.0-1019-azure
Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz
Test AuthMessage length with input size 1:  Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
-------------------------------------------------------------------------------------------------------------------------
Use Arrays.steam api                                  12             14           1          8.2         122.6       1.0X
Use Loop api                                           9             10           1         11.3          88.7       1.4X

OpenJDK 64-Bit Server VM 17.0.4+8-LTS on Linux 5.15.0-1019-azure
Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz
Test AuthMessage length with input size 5:  Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
-------------------------------------------------------------------------------------------------------------------------
Use Arrays.steam api                                  53             57           3          1.9         529.7       1.0X
Use Loop api                                          41             46           3          2.5         407.2       1.3X

OpenJDK 64-Bit Server VM 17.0.4+8-LTS on Linux 5.15.0-1019-azure
Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz
Test AuthMessage length with input size 10:  Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
--------------------------------------------------------------------------------------------------------------------------
Use Arrays.steam api                                   91             98           3          1.1         912.4       1.0X
Use Loop api                                           84             89           4          1.2         836.8       1.1X

OpenJDK 64-Bit Server VM 17.0.4+8-LTS on Linux 5.15.0-1019-azure
Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz
Test AuthMessage length with input size 20:  Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
--------------------------------------------------------------------------------------------------------------------------
Use Arrays.steam api                                  176            187           6          0.6        1763.0       1.0X
Use Loop api                                          168            173           5          0.6        1677.3       1.1X


OpenJDK 64-Bit Server VM 17.0.4+8-LTS on Linux 5.15.0-1019-azure
Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz
Test AuthMessage length with input size 50:  Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
--------------------------------------------------------------------------------------------------------------------------
Use Arrays.steam api                                  465            473          10          0.2        4647.2       1.0X
Use Loop api                                          432            438           5          0.2        4321.4       1.1X

OpenJDK 64-Bit Server VM 17.0.4+8-LTS on Linux 5.15.0-1019-azure
Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz
Test AuthMessage length with input size 100:  Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
---------------------------------------------------------------------------------------------------------------------------
Use Arrays.steam api                                   890            894           4          0.1        8898.3       1.0X
Use Loop api                                           876            881           7          0.1        8759.2       1.0X

OpenJDK 64-Bit Server VM 17.0.4+8-LTS on Linux 5.15.0-1019-azure
Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz
Test AuthMessage length with input size 500:  Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
---------------------------------------------------------------------------------------------------------------------------
Use Arrays.steam api                                  4490           4536          64          0.0       44904.1       1.0X
Use Loop api                                          4261           4368         151          0.0       42614.9       1.1X


OpenJDK 64-Bit Server VM 17.0.4+8-LTS on Linux 5.15.0-1019-azure
Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz
Test AuthMessage length with input size 1000:  Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
----------------------------------------------------------------------------------------------------------------------------
Use Arrays.steam api                                   9201           9232          44          0.0       92006.5       1.0X
Use Loop api                                           8849           8888          55          0.0       88491.8       1.0X

Test encode

public static  byte[] encodeAuthMessagesUseStreamApi(int length, AuthMessage[] encryptedPublicKeys) {
        ByteBuf transcript = Unpooled.buffer(length);
        Arrays.stream(encryptedPublicKeys).forEachOrdered(k -> k.encode(transcript));
        return transcript.array();
    }

vs

public static byte[] encodeAuthMessagesUseLoopApi(int length, AuthMessage[] encryptedPublicKeys) {
        ByteBuf transcript = Unpooled.buffer(length);
        for (AuthMessage k : encryptedPublicKeys) {
            k.encode(transcript);
        }
        return transcript.array();
    }

with AuthMessage[] size 1, 5, 10, 20, 50, 100, 500, 1000

Java 8

OpenJDK 64-Bit Server VM 1.8.0_345-b01 on Linux 5.15.0-1019-azure
Intel(R) Xeon(R) CPU E5-2673 v4 @ 2.30GHz
Test encode AuthMessages input size 1:    Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
------------------------------------------------------------------------------------------------------------------------
Use Arrays.steam api                                 48             53           3          2.1         477.4       1.0X
Use Loop api                                         47             53           3          2.1         465.8       1.0X


OpenJDK 64-Bit Server VM 1.8.0_345-b01 on Linux 5.15.0-1019-azure
Intel(R) Xeon(R) CPU E5-2673 v4 @ 2.30GHz
Test encode AuthMessages input size 5:    Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
------------------------------------------------------------------------------------------------------------------------
Use Arrays.steam api                                265            272           7          0.4        2653.0       1.0X
Use Loop api                                        257            263           4          0.4        2569.9       1.0X

OpenJDK 64-Bit Server VM 1.8.0_345-b01 on Linux 5.15.0-1019-azure
Intel(R) Xeon(R) CPU E5-2673 v4 @ 2.30GHz
Test encode AuthMessages input size 10:   Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
------------------------------------------------------------------------------------------------------------------------
Use Arrays.steam api                                507            519          11          0.2        5067.6       1.0X
Use Loop api                                        496            508          12          0.2        4961.8       1.0X


OpenJDK 64-Bit Server VM 1.8.0_345-b01 on Linux 5.15.0-1019-azure
Intel(R) Xeon(R) CPU E5-2673 v4 @ 2.30GHz
Test encode AuthMessages input size 20:   Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
------------------------------------------------------------------------------------------------------------------------
Use Arrays.steam api                               1003           1036          46          0.1       10032.3       1.0X
Use Loop api                                       1013           1028          21          0.1       10131.1       1.0X


OpenJDK 64-Bit Server VM 1.8.0_345-b01 on Linux 5.15.0-1019-azure
Intel(R) Xeon(R) CPU E5-2673 v4 @ 2.30GHz
Test encode AuthMessages input size 50:   Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
------------------------------------------------------------------------------------------------------------------------
Use Arrays.steam api                               2631           2633           3          0.0       26306.4       1.0X
Use Loop api                                       2549           2577          40          0.0       25487.7       1.0X


OpenJDK 64-Bit Server VM 1.8.0_345-b01 on Linux 5.15.0-1019-azure
Intel(R) Xeon(R) CPU E5-2673 v4 @ 2.30GHz
Test encode AuthMessages input size 100:  Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
------------------------------------------------------------------------------------------------------------------------
Use Arrays.steam api                               5172           5230          82          0.0       51718.0       1.0X
Use Loop api                                       5169           5177          11          0.0       51694.1       1.0X


OpenJDK 64-Bit Server VM 1.8.0_345-b01 on Linux 5.15.0-1019-azure
Intel(R) Xeon(R) CPU E5-2673 v4 @ 2.30GHz
Test encode AuthMessages input size 500:  Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
------------------------------------------------------------------------------------------------------------------------
Use Arrays.steam api                              24439          24919         679          0.0      244392.5       1.0X
Use Loop api                                      25461          25611         212          0.0      254614.0       1.0X

OpenJDK 64-Bit Server VM 1.8.0_345-b01 on Linux 5.15.0-1019-azure
Intel(R) Xeon(R) CPU E5-2673 v4 @ 2.30GHz
Test encode AuthMessages input size 1000:  Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
------------------------------------------------------------------------------------------------------------------------
Use Arrays.steam api                              48472          49171         988          0.0      484717.7       1.0X
Use Loop api                                      48377          49524        1622          0.0      483768.4       1.0X

Java 11

OpenJDK 64-Bit Server VM 11.0.16+8-LTS on Linux 5.15.0-1019-azure
Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz
Test encode AuthMessages input size 1:    Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
------------------------------------------------------------------------------------------------------------------------
Use Arrays.steam api                                 36             37           1          2.8         356.7       1.0X
Use Loop api                                         31             32           1          3.2         310.5       1.1X

OpenJDK 64-Bit Server VM 11.0.16+8-LTS on Linux 5.15.0-1019-azure
Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz
Test encode AuthMessages input size 5:    Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
------------------------------------------------------------------------------------------------------------------------
Use Arrays.steam api                                187            188           1          0.5        1869.0       1.0X
Use Loop api                                        184            188           6          0.5        1839.8       1.0X

OpenJDK 64-Bit Server VM 11.0.16+8-LTS on Linux 5.15.0-1019-azure
Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz
Test encode AuthMessages input size 10:   Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
------------------------------------------------------------------------------------------------------------------------
Use Arrays.steam api                                361            363           1          0.3        3611.1       1.0X
Use Loop api                                        350            354           4          0.3        3501.7       1.0X


OpenJDK 64-Bit Server VM 11.0.16+8-LTS on Linux 5.15.0-1019-azure
Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz
Test encode AuthMessages input size 20:   Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
------------------------------------------------------------------------------------------------------------------------
Use Arrays.steam api                                719            723           7          0.1        7189.9       1.0X
Use Loop api                                        705            711           5          0.1        7050.5       1.0X


OpenJDK 64-Bit Server VM 11.0.16+8-LTS on Linux 5.15.0-1019-azure
Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz
Test encode AuthMessages input size 50:   Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
------------------------------------------------------------------------------------------------------------------------
Use Arrays.steam api                               1812           1815           4          0.1       18122.5       1.0X
Use Loop api                                       1818           1826          11          0.1       18177.5       1.0X


OpenJDK 64-Bit Server VM 11.0.16+8-LTS on Linux 5.15.0-1019-azure
Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz
Test encode AuthMessages input size 100:  Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
------------------------------------------------------------------------------------------------------------------------
Use Arrays.steam api                               3562           3581          27          0.0       35621.0       1.0X
Use Loop api                                       3566           3568           3          0.0       35661.4       1.0X


OpenJDK 64-Bit Server VM 11.0.16+8-LTS on Linux 5.15.0-1019-azure
Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz
Test encode AuthMessages input size 500:  Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
------------------------------------------------------------------------------------------------------------------------
Use Arrays.steam api                              17799          17829          42          0.0      177994.6       1.0X
Use Loop api                                      17670          17701          45          0.0      176696.9       1.0X

OpenJDK 64-Bit Server VM 11.0.16+8-LTS on Linux 5.15.0-1019-azure
Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz
Test encode AuthMessages input size 1000:  Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
------------------------------------------------------------------------------------------------------------------------
Use Arrays.steam api                              38827          38857          42          0.0      388271.1       1.0X
Use Loop api                                      39481          39548          95          0.0      394812.2       1.0X

Java 17

OpenJDK 64-Bit Server VM 17.0.4+8-LTS on Linux 5.15.0-1019-azure
Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz
Test encode AuthMessages input size 1:    Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
------------------------------------------------------------------------------------------------------------------------
Use Arrays.steam api                                 28             29           1          3.6         277.5       1.0X
Use Loop api                                         23             24           1          4.4         229.7       1.2X

OpenJDK 64-Bit Server VM 17.0.4+8-LTS on Linux 5.15.0-1019-azure
Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz
Test encode AuthMessages input size 5:    Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
------------------------------------------------------------------------------------------------------------------------
Use Arrays.steam api                                122            127           3          0.8        1224.6       1.0X
Use Loop api                                        122            127           4          0.8        1215.6       1.0X

OpenJDK 64-Bit Server VM 17.0.4+8-LTS on Linux 5.15.0-1019-azure
Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz
Test encode AuthMessages input size 10:   Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
------------------------------------------------------------------------------------------------------------------------
Use Arrays.steam api                                247            259          15          0.4        2473.8       1.0X
Use Loop api                                        241            248           6          0.4        2410.5       1.0X

OpenJDK 64-Bit Server VM 17.0.4+8-LTS on Linux 5.15.0-1019-azure
Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz
Test encode AuthMessages input size 20:   Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
------------------------------------------------------------------------------------------------------------------------
Use Arrays.steam api                                494            513          24          0.2        4943.4       1.0X
Use Loop api                                        506            513           7          0.2        5058.7       1.0X

OpenJDK 64-Bit Server VM 17.0.4+8-LTS on Linux 5.15.0-1019-azure
Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz
Test encode AuthMessages input size 50:   Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
------------------------------------------------------------------------------------------------------------------------
Use Arrays.steam api                               1287           1291           6          0.1       12872.8       1.0X
Use Loop api                                       1217           1245          39          0.1       12169.4       1.1X

OpenJDK 64-Bit Server VM 17.0.4+8-LTS on Linux 5.15.0-1019-azure
Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz
Test encode AuthMessages input size 100:  Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
------------------------------------------------------------------------------------------------------------------------
Use Arrays.steam api                               2483           2493          15          0.0       24828.8       1.0X
Use Loop api                                       2490           2498          11          0.0       24904.0       1.0X

OpenJDK 64-Bit Server VM 17.0.4+8-LTS on Linux 5.15.0-1019-azure
Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz
Test encode AuthMessages input size 500:  Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
------------------------------------------------------------------------------------------------------------------------
Use Arrays.steam api                              13681          13696          20          0.0      136810.2       1.0X
Use Loop api                                      13112          13143          44          0.0      131117.7       1.0X


OpenJDK 64-Bit Server VM 17.0.4+8-LTS on Linux 5.15.0-1019-azure
Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz
Test encode AuthMessages input size 1000:  Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
------------------------------------------------------------------------------------------------------------------------
Use Arrays.steam api                              27704          27760          79          0.0      277041.3       1.0X
Use Loop api                                      27152          27175          33          0.0      271521.0       1.0X


Only when the input size is small has improvment, so not change in this pr

@LuciferYang LuciferYang changed the title [WIP][SPARK-40398][SQL] Use Loop instead of Arrays.stream api [SPARK-40398][SQL] Use Loop instead of Arrays.stream api Sep 10, 2022
@LuciferYang LuciferYang marked this pull request as ready for review September 10, 2022 12:03
@srowen
Copy link
Member

srowen commented Sep 10, 2022

Is the summary is that it's basically always a win? I'm convinced if so, just let me know when you have made all the changes you want to

@LuciferYang
Copy link
Contributor Author

This pr has been completed and waiting for CI

@LuciferYang
Copy link
Contributor Author

Yes, in most cases, loop is always better than Arrays.stream api, only AuthEngine#getTranscript in the analyzed cases doesn't need to be changed

@LuciferYang
Copy link
Contributor Author

@srowen If you have time, please help me review this. Thanks ~

return true;
}

private boolean isAnyBlockNotStartWithShuffleBlockPrefix(String[] blockIds) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can these be static methods?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all change to static or only OneForOneBlockFetcher ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

9c979c4 changed all possible

}
}
}
return list.toArray(new NamedReference[0]);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you need to build the List too? why not just .toArray on the Set, because ordering is important? LinkedHashSet could help there

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let met check this

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1ecf017 change to use LinkedHashSet, let me check the performance and waiting CI

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@srowen 8ff3b77 revert to the previous version, because from the local test, using LinkedHashSet is slower than using ArrayList + HashSet, which may be because LinkedHashSet.toArray is much slower than ArrayList.toArray.

Let's wait for the bench results from GA to verify multiple Java versions

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK that's fine, thanks for checking. Whatever seems most efficient

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

friendly ping @huaxingao Could you help confirm that is the ordering important for the result of Expression#references method?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The order shouldn't matter. Thanks for checking with me @LuciferYang

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @huaxingao

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mridulm @srowen 46d4a57 change to use HashSet due to the result order is not important, waiting CI and I will double check the bench result.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok to use HashSet if the result order is not important

@LuciferYang LuciferYang changed the title [SPARK-40398][SQL] Use Loop instead of Arrays.stream api [SPARK-40398][CORE][SQL] Use Loop instead of Arrays.stream api Sep 11, 2022
}
}
return false;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given this is not a perf critical path, I would recommend to keep this as is.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

Copy link
Member

@srowen srowen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks OK

@@ -17,7 +17,7 @@

package org.apache.spark.sql.connector.expressions;

import java.util.Arrays;
import java.util.*;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: I think we've avoided wildcard imports, just enumerate them?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -62,8 +61,7 @@ public String build(Expression expr) {
String name = e.name();
switch (name) {
case "IN": {
List<String> children =
Arrays.stream(e.children()).map(c -> build(c)).collect(Collectors.toList());
List<String> children = expressionsToStringList(e.children());
Copy link
Contributor

@mridulm mridulm Sep 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Given this is called only here, by not avoid the subList ? (give start offset and len params to expressionsToStringList)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is e00330f ok ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But the .subList only wraps a SubList object and does not trigger operations such as memory copy, so the performance gap may be small

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree, sublist is fairly optimal ... but can be avoided here is possible. It is a nit comment actually :-)

Copy link
Contributor

@mridulm mridulm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a minor nit, looks good to me.

for (Expression e : children()) {
Collections.addAll(set, e.references());
}
return set.toArray(new NamedReference[0]);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have one last tiny suggestion - either pass an array of size set.size(), or make a static final empty array and pass it here, to avoid allocating an empty array. It's tiny but hey we are micro-optimizing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

choice make a static final empty array and pass it here due to using an empty array is more recommended and the empty array is only used to get the target array class type.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Install dependencies for documentation generation failed, not relate to this one, re-run it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nstall dependencies for documentation generation still failed

https://github.com/LuciferYang/spark/actions/runs/3064658259/jobs/4947983207

 × Building wheel for pyzmq (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [186 lines of output]
      /tmp/pip-build-env-812k46kb/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py:262: UserWarning: Unknown distribution option: 'cffi_modules'
        warnings.warn(msg)
      running bdist_wheel
      running build
      running build_py
      copying zmq/error.py -> build/lib.linux-x86_64-cpython-39/zmq
      copying zmq/asyncio.py -> build/lib.linux-x86_64-cpython-39/zmq
      copying zmq/_future.py -> build/lib.linux-x86_64-cpython-39/zmq
      copying zmq/_typing.py -> build/lib.linux-x86_64-cpython-39/zmq
      copying zmq/decorators.py -> build/lib.linux-x86_64-cpython-39/zmq
      copying zmq/constants.py -> build/lib.linux-x86_64-cpython-39/zmq
      copying zmq/__init__.py -> build/lib.linux-x86_64-cpython-39/zmq
      creating build/lib.linux-x86_64-cpython-39/zmq/log
      copying zmq/log/__main__.py -> build/lib.linux-x86_64-cpython-39/zmq/log
      copying zmq/log/handlers.py -> build/lib.linux-x86_64-cpython-39/zmq/log
      copying zmq/log/__init__.py -> build/lib.linux-x86_64-cpython-39/zmq/log
      creating build/lib.linux-x86_64-cpython-39/zmq/green
      copying zmq/green/device.py -> build/lib.linux-x86_64-cpython-39/zmq/green
      copying zmq/green/poll.py -> build/lib.linux-x86_64-cpython-39/zmq/green
      copying zmq/green/core.py -> build/lib.linux-x86_64-cpython-39/zmq/green
      copying zmq/green/__init__.py -> build/lib.linux-x86_64-cpython-39/zmq/green
      creating build/lib.linux-x86_64-cpython-39/zmq/green/eventloop
      copying zmq/green/eventloop/ioloop.py -> build/lib.linux-x86_64-cpython-39/zmq/green/eventloop
      copying zmq/green/eventloop/zmqstream.py -> build/lib.linux-x86_64-cpython-39/zmq/green/eventloop
      copying zmq/green/eventloop/__init__.py -> build/lib.linux-x86_64-cpython-39/zmq/green/eventloop
      creating build/lib.linux-x86_64-cpython-39/zmq/tests
      copying zmq/tests/test_imports.py -> build/lib.linux-x86_64-cpython-39/zmq/tests
      copying zmq/tests/test_future.py -> build/lib.linux-x86_64-cpython-39/zmq/tests
      copying zmq/tests/test_asyncio.py -> build/lib.linux-x86_64-cpython-39/zmq/tests
      copying zmq/tests/test_win32_shim.py -> build/lib.linux-x86_64-cpython-39/zmq/tests
      copying zmq/tests/test_etc.py -> build/lib.linux-x86_64-cpython-39/zmq/tests
      copying zmq/tests/test_draft.py -> build/lib.linux-x86_64-cpython-39/zmq/tests
      copying zmq/tests/test_message.py -> build/lib.linux-x86_64-cpython-39/zmq/tests
      copying zmq/tests/test_monqueue.py -> build/lib.linux-x86_64-cpython-39/zmq/tests
      copying zmq/tests/test_multipart.py -> build/lib.linux-x86_64-cpython-39/zmq/tests
      copying zmq/tests/test_error.py -> build/lib.linux-x86_64-cpython-39/zmq/tests
      copying zmq/tests/test_constants.py -> build/lib.linux-x86_64-cpython-39/zmq/tests
      copying zmq/tests/test_poll.py -> build/lib.linux-x86_64-cpython-39/zmq/tests
      copying zmq/tests/conftest.py -> build/lib.linux-x86_64-cpython-39/zmq/tests
      copying zmq/tests/test_monitor.py -> build/lib.linux-x86_64-cpython-39/zmq/tests
      copying zmq/tests/test_security.py -> build/lib.linux-x86_64-cpython-39/zmq/tests
      copying zmq/tests/test_context.py -> build/lib.linux-x86_64-cpython-39/zmq/tests
      copying zmq/tests/test_mypy.py -> build/lib.linux-x86_64-cpython-39/zmq/tests
      copying zmq/tests/test_ssh.py -> build/lib.linux-x86_64-cpython-39/zmq/tests
      copying zmq/tests/test_z85.py -> build/lib.linux-x86_64-cpython-39/zmq/tests
      copying zmq/tests/test_cffi_backend.py -> build/lib.linux-x86_64-cpython-39/zmq/tests
      copying zmq/tests/test_ioloop.py -> build/lib.linux-x86_64-cpython-39/zmq/tests
      copying zmq/tests/test_auth.py -> build/lib.linux-x86_64-cpython-39/zmq/tests
      copying zmq/tests/test_pair.py -> build/lib.linux-x86_64-cpython-39/zmq/tests
      copying zmq/tests/test_device.py -> build/lib.linux-x86_64-cpython-39/zmq/tests
      copying zmq/tests/test_includes.py -> build/lib.linux-x86_64-cpython-39/zmq/tests
      copying zmq/tests/test_socket.py -> build/lib.linux-x86_64-cpython-39/zmq/tests
      copying zmq/tests/test_cython.py -> build/lib.linux-x86_64-cpython-39/zmq/tests
      copying zmq/tests/test_log.py -> build/lib.linux-x86_64-cpython-39/zmq/tests
      copying zmq/tests/test_pubsub.py -> build/lib.linux-x86_64-cpython-39/zmq/tests
      copying zmq/tests/test_ext.py -> build/lib.linux-x86_64-cpython-39/zmq/tests
      copying zmq/tests/test_zmqstream.py -> build/lib.linux-x86_64-cpython-39/zmq/tests
      copying zmq/tests/test_reqrep.py -> build/lib.linux-x86_64-cpython-39/zmq/tests
      copying zmq/tests/test_proxy_steerable.py -> build/lib.linux-x86_64-cpython-39/zmq/tests
      copying zmq/tests/__init__.py -> build/lib.linux-x86_64-cpython-39/zmq/tests
      copying zmq/tests/test_version.py -> build/lib.linux-x86_64-cpython-39/zmq/tests
      copying zmq/tests/test_retry_eintr.py -> build/lib.linux-x86_64-cpython-39/zmq/tests
      copying zmq/tests/test_decorators.py -> build/lib.linux-x86_64-cpython-39/zmq/tests
      creating build/lib.linux-x86_64-cpython-39/zmq/devices
      copying zmq/devices/proxydevice.py -> build/lib.linux-x86_64-cpython-39/zmq/devices
      copying zmq/devices/monitoredqueuedevice.py -> build/lib.linux-x86_64-cpython-39/zmq/devices
      copying zmq/devices/proxysteerabledevice.py -> build/lib.linux-x86_64-cpython-39/zmq/devices
      copying zmq/devices/monitoredqueue.py -> build/lib.linux-x86_64-cpython-39/zmq/devices
      copying zmq/devices/basedevice.py -> build/lib.linux-x86_64-cpython-39/zmq/devices
      copying zmq/devices/__init__.py -> build/lib.linux-x86_64-cpython-39/zmq/devices
      creating build/lib.linux-x86_64-cpython-39/zmq/auth
      copying zmq/auth/asyncio.py -> build/lib.linux-x86_64-cpython-39/zmq/auth
      copying zmq/auth/certs.py -> build/lib.linux-x86_64-cpython-39/zmq/auth
      copying zmq/auth/ioloop.py -> build/lib.linux-x86_64-cpython-39/zmq/auth
      copying zmq/auth/base.py -> build/lib.linux-x86_64-cpython-39/zmq/auth
      copying zmq/auth/__init__.py -> build/lib.linux-x86_64-cpython-39/zmq/auth
      copying zmq/auth/thread.py -> build/lib.linux-x86_64-cpython-39/zmq/auth
      creating build/lib.linux-x86_64-cpython-39/zmq/utils
      copying zmq/utils/interop.py -> build/lib.linux-x86_64-cpython-39/zmq/utils
      copying zmq/utils/garbage.py -> build/lib.linux-x86_64-cpython-39/zmq/utils
      copying zmq/utils/win32.py -> build/lib.linux-x86_64-cpython-39/zmq/utils
      copying zmq/utils/jsonapi.py -> build/lib.linux-x86_64-cpython-39/zmq/utils
      copying zmq/utils/monitor.py -> build/lib.linux-x86_64-cpython-39/zmq/utils
      copying zmq/utils/z85.py -> build/lib.linux-x86_64-cpython-39/zmq/utils
      copying zmq/utils/strtypes.py -> build/lib.linux-x86_64-cpython-39/zmq/utils
      copying zmq/utils/__init__.py -> build/lib.linux-x86_64-cpython-39/zmq/utils
      creating build/lib.linux-x86_64-cpython-39/zmq/backend
      copying zmq/backend/select.py -> build/lib.linux-x86_64-cpython-39/zmq/backend
      copying zmq/backend/__init__.py -> build/lib.linux-x86_64-cpython-39/zmq/backend
      creating build/lib.linux-x86_64-cpython-39/zmq/backend/cython
      copying zmq/backend/cython/__init__.py -> build/lib.linux-x86_64-cpython-39/zmq/backend/cython
      creating build/lib.linux-x86_64-cpython-39/zmq/backend/cffi
      copying zmq/backend/cffi/error.py -> build/lib.linux-x86_64-cpython-39/zmq/backend/cffi
      copying zmq/backend/cffi/context.py -> build/lib.linux-x86_64-cpython-39/zmq/backend/cffi
      copying zmq/backend/cffi/message.py -> build/lib.linux-x86_64-cpython-39/zmq/backend/cffi
      copying zmq/backend/cffi/_poll.py -> build/lib.linux-x86_64-cpython-39/zmq/backend/cffi
      copying zmq/backend/cffi/devices.py -> build/lib.linux-x86_64-cpython-39/zmq/backend/cffi
      copying zmq/backend/cffi/socket.py -> build/lib.linux-x86_64-cpython-39/zmq/backend/cffi
      copying zmq/backend/cffi/utils.py -> build/lib.linux-x86_64-cpython-39/zmq/backend/cffi
      copying zmq/backend/cffi/__init__.py -> build/lib.linux-x86_64-cpython-39/zmq/backend/cffi
      creating build/lib.linux-x86_64-cpython-39/zmq/sugar
      copying zmq/sugar/version.py -> build/lib.linux-x86_64-cpython-39/zmq/sugar
      copying zmq/sugar/tracker.py -> build/lib.linux-x86_64-cpython-39/zmq/sugar
      copying zmq/sugar/context.py -> build/lib.linux-x86_64-cpython-39/zmq/sugar
      copying zmq/sugar/attrsettr.py -> build/lib.linux-x86_64-cpython-39/zmq/sugar
      copying zmq/sugar/poll.py -> build/lib.linux-x86_64-cpython-39/zmq/sugar
      copying zmq/sugar/frame.py -> build/lib.linux-x86_64-cpython-39/zmq/sugar
      copying zmq/sugar/stopwatch.py -> build/lib.linux-x86_64-cpython-39/zmq/sugar
      copying zmq/sugar/socket.py -> build/lib.linux-x86_64-cpython-39/zmq/sugar
      copying zmq/sugar/__init__.py -> build/lib.linux-x86_64-cpython-39/zmq/sugar
      creating build/lib.linux-x86_64-cpython-39/zmq/ssh
      copying zmq/ssh/tunnel.py -> build/lib.linux-x86_64-cpython-39/zmq/ssh
      copying zmq/ssh/forward.py -> build/lib.linux-x86_64-cpython-39/zmq/ssh
      copying zmq/ssh/__init__.py -> build/lib.linux-x86_64-cpython-39/zmq/ssh
      creating build/lib.linux-x86_64-cpython-39/zmq/eventloop
      copying zmq/eventloop/ioloop.py -> build/lib.linux-x86_64-cpython-39/zmq/eventloop
      copying zmq/eventloop/zmqstream.py -> build/lib.linux-x86_64-cpython-39/zmq/eventloop
      copying zmq/eventloop/future.py -> build/lib.linux-x86_64-cpython-39/zmq/eventloop
      copying zmq/eventloop/_deprecated.py -> build/lib.linux-x86_64-cpython-39/zmq/eventloop
      copying zmq/eventloop/__init__.py -> build/lib.linux-x86_64-cpython-39/zmq/eventloop
      creating build/lib.linux-x86_64-cpython-39/zmq/eventloop/minitornado
      copying zmq/eventloop/minitornado/log.py -> build/lib.linux-x86_64-cpython-39/zmq/eventloop/minitornado
      copying zmq/eventloop/minitornado/stack_context.py -> build/lib.linux-x86_64-cpython-39/zmq/eventloop/minitornado
      copying zmq/eventloop/minitornado/concurrent.py -> build/lib.linux-x86_64-cpython-39/zmq/eventloop/minitornado
      copying zmq/eventloop/minitornado/ioloop.py -> build/lib.linux-x86_64-cpython-39/zmq/eventloop/minitornado
      copying zmq/eventloop/minitornado/util.py -> build/lib.linux-x86_64-cpython-39/zmq/eventloop/minitornado
      copying zmq/eventloop/minitornado/__init__.py -> build/lib.linux-x86_64-cpython-39/zmq/eventloop/minitornado
      creating build/lib.linux-x86_64-cpython-39/zmq/eventloop/minitornado/platform
      copying zmq/eventloop/minitornado/platform/interface.py -> build/lib.linux-x86_64-cpython-39/zmq/eventloop/minitornado/platform
      copying zmq/eventloop/minitornado/platform/auto.py -> build/lib.linux-x86_64-cpython-39/zmq/eventloop/minitornado/platform
      copying zmq/eventloop/minitornado/platform/common.py -> build/lib.linux-x86_64-cpython-39/zmq/eventloop/minitornado/platform
      copying zmq/eventloop/minitornado/platform/windows.py -> build/lib.linux-x86_64-cpython-39/zmq/eventloop/minitornado/platform
      copying zmq/eventloop/minitornado/platform/posix.py -> build/lib.linux-x86_64-cpython-39/zmq/eventloop/minitornado/platform
      copying zmq/eventloop/minitornado/platform/__init__.py -> build/lib.linux-x86_64-cpython-39/zmq/eventloop/minitornado/platform
      copying zmq/__init__.pxd -> build/lib.linux-x86_64-cpython-39/zmq
      copying zmq/__init__.pyi -> build/lib.linux-x86_64-cpython-39/zmq
      copying zmq/py.typed -> build/lib.linux-x86_64-cpython-39/zmq
      copying zmq/devices/monitoredqueue.pxd -> build/lib.linux-x86_64-cpython-39/zmq/devices
      copying zmq/utils/buffers.pxd -> build/lib.linux-x86_64-cpython-39/zmq/utils
      copying zmq/utils/zmq_compat.h -> build/lib.linux-x86_64-cpython-39/zmq/utils
      copying zmq/utils/pyversion_compat.h -> build/lib.linux-x86_64-cpython-39/zmq/utils
      copying zmq/utils/mutex.h -> build/lib.linux-x86_64-cpython-39/zmq/utils
      copying zmq/utils/ipcmaxlen.h -> build/lib.linux-x86_64-cpython-39/zmq/utils
      copying zmq/utils/getpid_compat.h -> build/lib.linux-x86_64-cpython-39/zmq/utils
      copying zmq/utils/compiler.json -> build/lib.linux-x86_64-cpython-39/zmq/utils
      copying zmq/utils/config.json -> build/lib.linux-x86_64-cpython-39/zmq/utils
      copying zmq/backend/__init__.pyi -> build/lib.linux-x86_64-cpython-39/zmq/backend
      copying zmq/backend/cython/context.pxd -> build/lib.linux-x86_64-cpython-39/zmq/backend/cython
      copying zmq/backend/cython/socket.pxd -> build/lib.linux-x86_64-cpython-39/zmq/backend/cython
      copying zmq/backend/cython/__init__.pxd -> build/lib.linux-x86_64-cpython-39/zmq/backend/cython
      copying zmq/backend/cython/message.pxd -> build/lib.linux-x86_64-cpython-39/zmq/backend/cython
      copying zmq/backend/cython/checkrc.pxd -> build/lib.linux-x86_64-cpython-39/zmq/backend/cython
      copying zmq/backend/cython/libzmq.pxd -> build/lib.linux-x86_64-cpython-39/zmq/backend/cython
      copying zmq/backend/cython/constant_enums.pxi -> build/lib.linux-x86_64-cpython-39/zmq/backend/cython
      copying zmq/backend/cffi/_cdefs.h -> build/lib.linux-x86_64-cpython-39/zmq/backend/cffi
      copying zmq/sugar/__init__.pyi -> build/lib.linux-x86_64-cpython-39/zmq/sugar
      running build_ext
      running configure
      Using bundled libzmq
      already have bundled/zeromq
      already have platform.hpp
      checking for timer_create
      ************************************************
      ************************************************
      x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/usr/include/python3.9 -c /tmp/timer_createwdqm_dcl.c -o tmp/timer_createwdqm_dcl.o
      /tmp/timer_createwdqm_dcl.c: In function ‘main’:
      /tmp/timer_createwdqm_dcl.c:2:5: warning: implicit declaration of function ‘timer_create’ [-Wimplicit-function-declaration]
          2 |     timer_create();
            |     ^~~~~~~~~~~~
      x86_64-linux-gnu-gcc -pthread tmp/timer_createwdqm_dcl.o -L/usr/lib/x86_64-linux-gnu -o a.out
      /usr/bin/ld: tmp/timer_createwdqm_dcl.o: in function `main':
      /tmp/timer_createwdqm_dcl.c:2: undefined reference to `timer_create'
      collect2: error: ld returned 1 exit status
      no timer_create, linking librt
      ************************************************
      building 'zmq.libzmq' extension
      creating build/temp.linux-x86_64-cpython-39/buildutils
      creating build/temp.linux-x86_64-cpython-39/bundled
      creating build/temp.linux-x86_64-cpython-39/bundled/zeromq
      creating build/temp.linux-x86_64-cpython-39/bundled/zeromq/src
      x86_64-linux-gnu-g++ -pthread -std=c++11 -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -DZMQ_HAVE_CURVE=1 -DZMQ_USE_TWEETNACL=1 -DZMQ_USE_EPOLL=1 -DZMQ_IOTHREADS_USE_EPOLL=1 -DZMQ_POLL_BASED_ON_POLL=1 -Ibundled/zeromq/include -Ibundled -I/usr/include/python3.9 -c buildutils/initlibzmq.cpp -o build/temp.linux-x86_64-cpython-39/buildutils/initlibzmq.o
      buildutils/initlibzmq.cpp:10:10: fatal error: Python.h: No such file or directory
         10 | #include "Python.h"
            |          ^~~~~~~~~~
      compilation terminated.
      error: command '/usr/bin/x86_64-linux-gnu-g++' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pyzmq
ERROR: Could not build wheels for pyzmq, which is required to install pyproject.toml-based projects
Failed to build pyzmq
Error: Process completed with exit code 1.

friendly ping @HyukjinKwon @Yikun to help to check this

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess already addressed here: #37904

mind to rebase?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

has been rebased, thank you @Yikun

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change to Python linter check failed...
https://github.com/LuciferYang/spark/actions/runs/3065275580/jobs/4949221030

starting mypy annotations test...
annotations failed mypy checks:
python/pyspark/pandas/window.py:112: error: Module has no attribute "lit"  [attr-defined]
Found 1 error in 1 file (checked 340 source files)
1

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GA passed

@LuciferYang
Copy link
Contributor Author

rebase and re-run GA

@srowen
Copy link
Member

srowen commented Sep 16, 2022

Merged to master

@srowen srowen closed this in d71b180 Sep 16, 2022
@LuciferYang
Copy link
Contributor Author

thanks @srowen @mridulm @huaxingao for review ~
thanks @Yikun @HyukjinKwon for helping solve GA issue

LuciferYang added a commit to LuciferYang/spark that referenced this pull request Sep 20, 2022
### What changes were proposed in this pull request?
This PR replaces `Arrays.stream` api with loop where performance improvement can be obtained.

### Why are the changes needed?
Minor performance improvement.

### Does this PR introduce _any_ user-facing change?
No

### How was this patch tested?
Pass Github actions

Closes apache#37843 from LuciferYang/ExpressionArrayToStrings.

Authored-by: yangjie01 <yangjie01@baidu.com>
Signed-off-by: Sean Owen <srowen@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants