Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
a2986b7
add new test group
LuciferYang Jun 12, 2023
afcf17b
fix compile
LuciferYang Jun 12, 2023
0c718a4
for ga
LuciferYang Jun 12, 2023
f1d10d1
use expression
LuciferYang Jun 12, 2023
0000c8a
Merge branch 'upmaster' into new-sql-test-group
LuciferYang Jun 13, 2023
72802fd
add more to this group
LuciferYang Jun 13, 2023
29d226c
fix compile
LuciferYang Jun 13, 2023
4b9ac23
fix compile
LuciferYang Jun 13, 2023
22b0cca
Merge branch 'apache:master' into new-sql-test-group
LuciferYang Jun 14, 2023
ea29840
for ga
LuciferYang Jun 14, 2023
1fee0c3
add ExtendedStructuredStreamingTest
LuciferYang Jun 14, 2023
0201320
remove tag of V1WriteCommandSuiteBase
LuciferYang Jun 14, 2023
bdc1c8d
Merge branch 'apache:master' into new-sql-test-group
LuciferYang Jun 14, 2023
912cf21
for ga
LuciferYang Jun 14, 2023
c38888e
make slow tag
LuciferYang Jun 14, 2023
0e3e8ef
rename to SQLTestGroupOne
LuciferYang Jun 14, 2023
4e5d30a
Merge branch 'upmaster' into new-sql-test-group
LuciferYang Jun 15, 2023
971cd45
remove not slow
LuciferYang Jun 15, 2023
5867d27
rename to SlowTest
LuciferYang Jun 15, 2023
aacb42e
Merge branch 'upmaster' into new-sql-test-group
LuciferYang Jun 15, 2023
193503c
ignore Logging plan changes for execution
LuciferYang Jun 16, 2023
3e3e824
add more slow
LuciferYang Jun 16, 2023
795d09f
add more slow
LuciferYang Jun 16, 2023
a5ed847
add more tests
LuciferYang Jun 16, 2023
c0b944a
Merge branch 'apache:master' into new-sql-test-group
LuciferYang Jun 17, 2023
d5a0c39
[SPARK-43928][SQL][PYTHON][CONNECT] Add bit operations to Scala, Pyth…
beliefer Jun 17, 2023
c0a1c4c
[MINOR][DOCS] Remove double quote to fix link
Jun 17, 2023
f3c9e12
[SPARK-44052][CONNECT][PS] Add util to get proper Column or DataFrame…
itholic Jun 17, 2023
1c9d6d2
[MINOR][K8S][DOCS] Fix all dead links for K8s doc
wangyum Jun 17, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -175,12 +175,27 @@ jobs:
hadoop: ${{ inputs.hadoop }}
hive: hive2.3
included-tags: org.apache.spark.tags.ExtendedSQLTest
comment: "- extended tests"
- modules: sql
java: ${{ inputs.java }}
hadoop: ${{ inputs.hadoop }}
hive: hive2.3
# Using a tag that will not appear in sql module for placeholder, branch-3.3 and branch-3.4 will not run any UTs.
included-tags: >-
${{
((inputs.branch == 'branch-3.3' || inputs.branch == 'branch-3.4') && 'org.apache.spark.tags.SlowHiveTest')
|| 'org.apache.spark.tags.SlowSQLTest'
}}
comment: "- slow tests"
- modules: sql
java: ${{ inputs.java }}
hadoop: ${{ inputs.hadoop }}
hive: hive2.3
excluded-tags: org.apache.spark.tags.ExtendedSQLTest
excluded-tags: >-
${{
((inputs.branch == 'branch-3.3' || inputs.branch == 'branch-3.4') && 'org.apache.spark.tags.ExtendedSQLTest')
|| 'org.apache.spark.tags.ExtendedSQLTest,org.apache.spark.tags.SlowSQLTest'
}}
comment: "- other tests"
env:
MODULES_TO_TEST: ${{ matrix.modules }}
Expand Down
30 changes: 30 additions & 0 deletions common/tags/src/test/java/org/apache/spark/tags/SlowSQLTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.spark.tags;

import org.scalatest.TagAnnotation;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@TagAnnotation
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.METHOD, ElementType.TYPE})
public @interface SlowSQLTest { }
Original file line number Diff line number Diff line change
Expand Up @@ -1251,6 +1251,30 @@ object functions {
*/
def bool_or(e: Column): Column = Column.fn("bool_or", e)

/**
* Aggregate function: returns the bitwise AND of all non-null input values, or null if none.
*
* @group agg_funcs
* @since 3.5.0
*/
def bit_and(e: Column): Column = Column.fn("bit_and", e)

/**
* Aggregate function: returns the bitwise OR of all non-null input values, or null if none.
*
* @group agg_funcs
* @since 3.5.0
*/
def bit_or(e: Column): Column = Column.fn("bit_or", e)

/**
* Aggregate function: returns the bitwise XOR of all non-null input values, or null if none.
*
* @group agg_funcs
* @since 3.5.0
*/
def bit_xor(e: Column): Column = Column.fn("bit_xor", e)

//////////////////////////////////////////////////////////////////////////////////////////////
// Window functions
//////////////////////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -1851,6 +1875,33 @@ object functions {
*/
def bitwise_not(e: Column): Column = Column.fn("~", e)

/**
* Returns the number of bits that are set in the argument expr as an unsigned 64-bit integer,
* or NULL if the argument is NULL.
*
* @group bitwise_funcs
* @since 3.5.0
*/
def bit_count(e: Column): Column = Column.fn("bit_count", e)

/**
* Returns the value of the bit (0 or 1) at the specified position. The positions are numbered
* from right to left, starting at zero. The position argument cannot be negative.
*
* @group bitwise_funcs
* @since 3.5.0
*/
def bit_get(e: Column, pos: Column): Column = Column.fn("bit_get", e, pos)

/**
* Returns the value of the bit (0 or 1) at the specified position. The positions are numbered
* from right to left, starting at zero. The position argument cannot be negative.
*
* @group bitwise_funcs
* @since 3.5.0
*/
def getbit(e: Column, pos: Column): Column = Column.fn("getbit", e, pos)

/**
* Parses the expression string into the column that it represents, similar to
* [[Dataset#selectExpr]].
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1009,6 +1009,18 @@ class PlanGenerationTestSuite
fn.histogram_numeric(fn.col("a"), lit(10))
}

functionTest("bit_and") {
fn.bit_and(fn.col("a"))
}

functionTest("bit_or") {
fn.bit_or(fn.col("a"))
}

functionTest("bit_xor") {
fn.bit_xor(fn.col("a"))
}

functionTest("mode") {
fn.mode(fn.col("a"))
}
Expand Down Expand Up @@ -1209,6 +1221,18 @@ class PlanGenerationTestSuite
fn.bitwise_not(fn.col("a"))
}

functionTest("bit_count") {
fn.bit_count(fn.col("a"))
}

functionTest("bit_get") {
fn.bit_get(fn.col("a"), lit(0))
}

functionTest("getbit") {
fn.getbit(fn.col("a"), lit(0))
}

functionTest("expr") {
fn.expr("a + 1")
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Aggregate [bit_and(a#0) AS bit_and(a)#0]
+- LocalRelation <empty>, [id#0L, a#0, b#0, d#0, e#0, f#0, g#0]
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Project [bit_count(a#0) AS bit_count(a)#0]
+- LocalRelation <empty>, [id#0L, a#0, b#0, d#0, e#0, f#0, g#0]
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Project [bit_get(a#0, 0) AS bit_get(a, 0)#0]
+- LocalRelation <empty>, [id#0L, a#0, b#0, d#0, e#0, f#0, g#0]
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Aggregate [bit_or(a#0) AS bit_or(a)#0]
+- LocalRelation <empty>, [id#0L, a#0, b#0, d#0, e#0, f#0, g#0]
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Aggregate [bit_xor(a#0) AS bit_xor(a)#0]
+- LocalRelation <empty>, [id#0L, a#0, b#0, d#0, e#0, f#0, g#0]
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Project [getbit(a#0, 0) AS getbit(a, 0)#0]
+- LocalRelation <empty>, [id#0L, a#0, b#0, d#0, e#0, f#0, g#0]
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"common": {
"planId": "1"
},
"project": {
"input": {
"common": {
"planId": "0"
},
"localRelation": {
"schema": "struct\u003cid:bigint,a:int,b:double,d:struct\u003cid:bigint,a:int,b:double\u003e,e:array\u003cint\u003e,f:map\u003cstring,struct\u003cid:bigint,a:int,b:double\u003e\u003e,g:string\u003e"
}
},
"expressions": [{
"unresolvedFunction": {
"functionName": "bit_and",
"arguments": [{
"unresolvedAttribute": {
"unparsedIdentifier": "a"
}
}]
}
}]
}
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"common": {
"planId": "1"
},
"project": {
"input": {
"common": {
"planId": "0"
},
"localRelation": {
"schema": "struct\u003cid:bigint,a:int,b:double,d:struct\u003cid:bigint,a:int,b:double\u003e,e:array\u003cint\u003e,f:map\u003cstring,struct\u003cid:bigint,a:int,b:double\u003e\u003e,g:string\u003e"
}
},
"expressions": [{
"unresolvedFunction": {
"functionName": "bit_count",
"arguments": [{
"unresolvedAttribute": {
"unparsedIdentifier": "a"
}
}]
}
}]
}
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"common": {
"planId": "1"
},
"project": {
"input": {
"common": {
"planId": "0"
},
"localRelation": {
"schema": "struct\u003cid:bigint,a:int,b:double,d:struct\u003cid:bigint,a:int,b:double\u003e,e:array\u003cint\u003e,f:map\u003cstring,struct\u003cid:bigint,a:int,b:double\u003e\u003e,g:string\u003e"
}
},
"expressions": [{
"unresolvedFunction": {
"functionName": "bit_get",
"arguments": [{
"unresolvedAttribute": {
"unparsedIdentifier": "a"
}
}, {
"literal": {
"integer": 0
}
}]
}
}]
}
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"common": {
"planId": "1"
},
"project": {
"input": {
"common": {
"planId": "0"
},
"localRelation": {
"schema": "struct\u003cid:bigint,a:int,b:double,d:struct\u003cid:bigint,a:int,b:double\u003e,e:array\u003cint\u003e,f:map\u003cstring,struct\u003cid:bigint,a:int,b:double\u003e\u003e,g:string\u003e"
}
},
"expressions": [{
"unresolvedFunction": {
"functionName": "bit_or",
"arguments": [{
"unresolvedAttribute": {
"unparsedIdentifier": "a"
}
}]
}
}]
}
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"common": {
"planId": "1"
},
"project": {
"input": {
"common": {
"planId": "0"
},
"localRelation": {
"schema": "struct\u003cid:bigint,a:int,b:double,d:struct\u003cid:bigint,a:int,b:double\u003e,e:array\u003cint\u003e,f:map\u003cstring,struct\u003cid:bigint,a:int,b:double\u003e\u003e,g:string\u003e"
}
},
"expressions": [{
"unresolvedFunction": {
"functionName": "bit_xor",
"arguments": [{
"unresolvedAttribute": {
"unparsedIdentifier": "a"
}
}]
}
}]
}
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"common": {
"planId": "1"
},
"project": {
"input": {
"common": {
"planId": "0"
},
"localRelation": {
"schema": "struct\u003cid:bigint,a:int,b:double,d:struct\u003cid:bigint,a:int,b:double\u003e,e:array\u003cint\u003e,f:map\u003cstring,struct\u003cid:bigint,a:int,b:double\u003e\u003e,g:string\u003e"
}
},
"expressions": [{
"unresolvedFunction": {
"functionName": "getbit",
"arguments": [{
"unresolvedAttribute": {
"unparsedIdentifier": "a"
}
}, {
"literal": {
"integer": 0
}
}]
}
}]
}
}
Binary file not shown.
Loading