Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
-- 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.

-- Config: spark.comet.exec.scalaUDF.codegen.enabled=false
-- Config: spark.comet.caseConversion.enabled=false

statement
CREATE TABLE routing_case_conversion(s STRING) USING parquet

statement
INSERT INTO routing_case_conversion VALUES ('Hello world'), (''), (NULL)

query expect_fallback(upper: spark.comet.exec.scalaUDF.codegen.enabled=false)
SELECT upper(s) FROM routing_case_conversion

query expect_fallback(lower: spark.comet.exec.scalaUDF.codegen.enabled=false)
SELECT lower(s) FROM routing_case_conversion
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
-- 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.

-- Config: spark.comet.exec.scalaUDF.codegen.enabled=true
-- Config: spark.comet.caseConversion.enabled=false

statement
CREATE TABLE routing_case_conversion(s STRING) USING parquet

statement
INSERT INTO routing_case_conversion VALUES ('Hello world'), (''), (NULL)

query expect_dispatch(upper)
SELECT upper(s) FROM routing_case_conversion

query expect_dispatch(lower)
SELECT lower(s) FROM routing_case_conversion
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
-- 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.

-- Config: spark.comet.exec.scalaUDF.codegen.enabled=false
-- Config: spark.comet.caseConversion.enabled=true

statement
CREATE TABLE routing_case_conversion(s STRING) USING parquet

statement
INSERT INTO routing_case_conversion VALUES ('Hello world'), (''), (NULL)

query expect_native(upper)
SELECT upper(s) FROM routing_case_conversion

query expect_native(lower)
SELECT lower(s) FROM routing_case_conversion
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
-- 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.

-- Config: spark.comet.exec.scalaUDF.codegen.enabled=false
-- Config: spark.comet.expression.InitCap.allowIncompatible=false
-- Config: spark.comet.expression.StringReplace.allowIncompatible=false
-- Config: spark.comet.expression.GetJsonObject.allowIncompatible=false

statement
CREATE TABLE routing_string_opt_in(s STRING, j STRING) USING parquet

statement
INSERT INTO routing_string_opt_in VALUES ('hello world', '{"a":1}'), ('', '{}'), (NULL, NULL)

query expect_fallback(initcap: spark.comet.exec.scalaUDF.codegen.enabled=false)
SELECT initcap(s) FROM routing_string_opt_in

query expect_fallback(replace: spark.comet.exec.scalaUDF.codegen.enabled=false)
SELECT replace(s, 'l', 'L') FROM routing_string_opt_in

query expect_fallback(get_json_object: spark.comet.exec.scalaUDF.codegen.enabled=false)
SELECT get_json_object(j, '$.a') FROM routing_string_opt_in
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
-- 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.

-- Config: spark.comet.exec.scalaUDF.codegen.enabled=true
-- Config: spark.comet.expression.InitCap.allowIncompatible=false
-- Config: spark.comet.expression.StringReplace.allowIncompatible=false
-- Config: spark.comet.expression.GetJsonObject.allowIncompatible=false

statement
CREATE TABLE routing_string_opt_in(s STRING, j STRING) USING parquet

statement
INSERT INTO routing_string_opt_in VALUES ('hello world', '{"a":1}'), ('', '{}'), (NULL, NULL)

query expect_dispatch(initcap)
SELECT initcap(s) FROM routing_string_opt_in

query expect_dispatch(replace)
SELECT replace(s, 'l', 'L') FROM routing_string_opt_in

query expect_dispatch(get_json_object)
SELECT get_json_object(j, '$.a') FROM routing_string_opt_in
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
-- 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.

-- Config: spark.comet.exec.scalaUDF.codegen.enabled=false
-- Config: spark.comet.expression.InitCap.allowIncompatible=true
-- Config: spark.comet.expression.StringReplace.allowIncompatible=true
-- Config: spark.comet.expression.GetJsonObject.allowIncompatible=true

statement
CREATE TABLE routing_string_opt_in(s STRING, j STRING) USING parquet

statement
INSERT INTO routing_string_opt_in VALUES ('hello world', '{"a":1}'), ('', '{}'), (NULL, NULL)

query expect_native(initcap)
SELECT initcap(s) FROM routing_string_opt_in

query expect_native(replace)
SELECT replace(s, 'l', 'L') FROM routing_string_opt_in

query expect_native(get_json_object)
SELECT get_json_object(j, '$.a') FROM routing_string_opt_in
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
-- 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.

-- Config: spark.comet.exec.scalaUDF.codegen.enabled=false
-- Config: spark.comet.expression.StringTranslate.allowIncompatible=false

statement
CREATE TABLE routing_strings(s STRING, p STRING, b BINARY, a ARRAY<INT>) USING parquet

statement
INSERT INTO routing_strings VALUES ('h_llo', 'h_llo', unhex('4142'), array(1, 2)), ('hello', 'h_llo', unhex(''), array()), (NULL, NULL, NULL, NULL)

query expect_native(like)
SELECT s LIKE p FROM routing_strings

query expect_native(concat)
SELECT concat(s, '!') FROM routing_strings

query expect_native(concat_ws)
SELECT concat_ws('-', s, 'x') FROM routing_strings

query expect_fallback(like: spark.comet.exec.scalaUDF.codegen.enabled=false)
SELECT s LIKE 'h$_llo' ESCAPE '$' FROM routing_strings

query expect_fallback(concat: spark.comet.exec.scalaUDF.codegen.enabled=false)
SELECT concat(b, b), concat(a, a) FROM routing_strings

query expect_fallback(concat_ws: spark.comet.exec.scalaUDF.codegen.enabled=false)
SELECT concat_ws('-', 'a', 'b')

query expect_fallback(translate: spark.comet.exec.scalaUDF.codegen.enabled=false)
SELECT translate(s, 'hl', 'HL') FROM routing_strings
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
-- 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.

-- Config: spark.comet.exec.scalaUDF.codegen.enabled=true
-- Config: spark.comet.expression.StringTranslate.allowIncompatible=false

statement
CREATE TABLE routing_strings(s STRING, p STRING, b BINARY, a ARRAY<INT>) USING parquet

statement
INSERT INTO routing_strings VALUES ('h_llo', 'h_llo', unhex('4142'), array(1, 2)), ('hello', 'h_llo', unhex(''), array()), (NULL, NULL, NULL, NULL)

query expect_native(like)
SELECT s LIKE p FROM routing_strings

query expect_native(concat)
SELECT concat(s, '!') FROM routing_strings

query expect_native(concat_ws)
SELECT concat_ws('-', s, 'x') FROM routing_strings

query expect_dispatch(like)
SELECT s LIKE 'h$_llo' ESCAPE '$' FROM routing_strings

query expect_dispatch(concat)
SELECT concat(b, b), concat(a, a) FROM routing_strings

query expect_dispatch(concat_ws)
SELECT concat_ws('-', 'a', 'b')

query expect_dispatch(translate)
SELECT translate(s, 'hl', 'HL') FROM routing_strings
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
-- 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.

-- Config: spark.comet.exec.scalaUDF.codegen.enabled=false
-- Config: spark.comet.expression.StringTranslate.allowIncompatible=true

statement
CREATE TABLE routing_strings(s STRING, p STRING, b BINARY, a ARRAY<INT>) USING parquet

statement
INSERT INTO routing_strings VALUES ('h_llo', 'h_llo', unhex('4142'), array(1, 2)), ('hello', 'h_llo', unhex(''), array()), (NULL, NULL, NULL, NULL)

query expect_native(like)
SELECT s LIKE p FROM routing_strings

query expect_native(concat)
SELECT concat(s, '!') FROM routing_strings

query expect_native(concat_ws)
SELECT concat_ws('-', s, 'x') FROM routing_strings

query expect_fallback(like: spark.comet.exec.scalaUDF.codegen.enabled=false)
SELECT s LIKE 'h$_llo' ESCAPE '$' FROM routing_strings

query expect_fallback(concat: spark.comet.exec.scalaUDF.codegen.enabled=false)
SELECT concat(b, b), concat(a, a) FROM routing_strings

query expect_fallback(concat_ws: spark.comet.exec.scalaUDF.codegen.enabled=false)
SELECT concat_ws('-', 'a', 'b')

query expect_native(translate)
SELECT translate(s, 'hl', 'HL') FROM routing_strings
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
-- 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.

-- Config: spark.comet.exec.scalaUDF.codegen.enabled=false

statement
CREATE TABLE routing_unbase64(s STRING) USING parquet

statement
INSERT INTO routing_unbase64 VALUES ('aGVsbG8='), (''), (NULL)

query expect_native(unbase64)
SELECT unbase64(s) FROM routing_unbase64

query expect_fallback(unbase64: spark.comet.exec.scalaUDF.codegen.enabled=false)
SELECT unbase64(concat(s, '')) FROM routing_unbase64

query expect_fallback(unbase64: spark.comet.exec.scalaUDF.codegen.enabled=false)
SELECT to_binary(s, 'base64') FROM routing_unbase64
Loading
Loading