Skip to content

Commit 341aaad

Browse files
committed
Update the test to solve the error in the integration
1 parent d7bda4e commit 341aaad

File tree

2 files changed

+33
-33
lines changed

2 files changed

+33
-33
lines changed

src/test/scala/org/apache/spark/sql/hbase/HBaseAdditionalQuerySuite.scala

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
/*
2-
* Licensed to the Apache Software Foundation (ASF) under one or more
3-
* contributor license agreements. See the NOTICE file distributed with
4-
* this work for additional information regarding copyright ownership.
5-
* The ASF licenses this file to You under the Apache License, Version 2.0
6-
* (the "License"); you may not use this file except in compliance with
7-
* the License. You may obtain a copy of the License at
8-
*
9-
* http://www.apache.org/licenses/LICENSE-2.0
10-
*
11-
* Unless required by applicable law or agreed to in writing, software
12-
* distributed under the License is distributed on an "AS IS" BASIS,
13-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14-
* See the License for the specific language governing permissions and
15-
* limitations under the License.
16-
*/
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to You under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
1717

1818
package org.apache.spark.sql.hbase
1919

@@ -97,7 +97,7 @@ class HBaseAdditionalQuerySuite extends TestBase {
9797
}
9898

9999
def createTableFromParquet() = {
100-
val outputFile = hbaseHome + "/users.parquet"
100+
val outputFile = "file://" + hbaseHome + "/users.parquet"
101101
val parquetTable = TestHbase.read.parquet(outputFile)
102102
parquetTable.registerTempTable("parquetTable")
103103
}

src/test/scala/org/apache/spark/sql/hbase/HBaseSQLQuerySuite.scala

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,13 @@ class HBaseSQLQuerySuite extends TestBaseWithSplitData {
6868
test("SPARK-3176 Added Parser of SQL ABS()") {
6969
checkAnswer(
7070
sql("SELECT ABS(-1.3)"),
71-
Row(1.3))
71+
Row(BigDecimal(1.3)))
7272
checkAnswer(
7373
sql("SELECT ABS(0.0)"),
74-
Row(0.0))
74+
Row(BigDecimal(0.0)))
7575
checkAnswer(
7676
sql("SELECT ABS(2.5)"),
77-
Row(2.5))
77+
Row(BigDecimal(2.5)))
7878
}
7979

8080
test("aggregation with codegen") {
@@ -579,31 +579,31 @@ class HBaseSQLQuerySuite extends TestBaseWithSplitData {
579579
val nonexistentKey = "nonexistent"
580580

581581
// "set" itself returns all config variables currently specified in SQLConf.
582-
assert(sql("SET").collect().length == 0)
582+
assert(sql("SET").collect().size == 0)
583583

584584
// "set key=val"
585585
sql(s"SET $testKey=$testVal")
586586
checkAnswer(
587587
sql("SET"),
588-
Row(s"$testKey=$testVal")
588+
Row(testKey, testVal)
589589
)
590590

591591
sql(s"SET ${testKey + testKey}=${testVal + testVal}")
592592
checkAnswer(
593593
sql("set"),
594594
Seq(
595-
Row(s"$testKey=$testVal"),
596-
Row(s"${testKey + testKey}=${testVal + testVal}"))
595+
Row(testKey, testVal),
596+
Row(testKey + testKey, testVal + testVal))
597597
)
598598

599599
// "set key"
600600
checkAnswer(
601601
sql(s"SET $testKey"),
602-
Row(s"$testKey=$testVal")
602+
Row(testKey, testVal)
603603
)
604604
checkAnswer(
605605
sql(s"SET $nonexistentKey"),
606-
Row(s"$nonexistentKey=<undefined>")
606+
Row(nonexistentKey, "<undefined>")
607607
)
608608
conf.clear()
609609
}
@@ -790,19 +790,19 @@ class HBaseSQLQuerySuite extends TestBaseWithSplitData {
790790

791791
test("Floating point number format") {
792792
checkAnswer(
793-
sql("SELECT 0.3"), Row(0.3)
793+
sql("SELECT 0.3"), Row(BigDecimal(0.3))
794794
)
795795

796796
checkAnswer(
797-
sql("SELECT -0.8"), Row(-0.8)
797+
sql("SELECT -0.8"), Row(BigDecimal(-0.8))
798798
)
799799

800800
checkAnswer(
801-
sql("SELECT .5"), Row(0.5)
801+
sql("SELECT .5"), Row(BigDecimal(0.5))
802802
)
803803

804804
checkAnswer(
805-
sql("SELECT -.18"), Row(-0.18)
805+
sql("SELECT -.18"), Row(BigDecimal(-0.18))
806806
)
807807
}
808808

@@ -827,19 +827,19 @@ class HBaseSQLQuerySuite extends TestBaseWithSplitData {
827827
test("Test to check we can apply sign to expression") {
828828

829829
checkAnswer(
830-
sql("SELECT -100"), Row(-100)
830+
sql("SELECT -100"), Row(BigDecimal(-100))
831831
)
832832

833833
checkAnswer(
834-
sql("SELECT +230"), Row(230)
834+
sql("SELECT +230"), Row(BigDecimal(230))
835835
)
836836

837837
checkAnswer(
838-
sql("SELECT -5.2"), Row(-5.2)
838+
sql("SELECT -5.2"), Row(BigDecimal(-5.2))
839839
)
840840

841841
checkAnswer(
842-
sql("SELECT +6.8"), Row(6.8)
842+
sql("SELECT +6.8"), Row(BigDecimal(6.8))
843843
)
844844

845845
checkAnswer(

0 commit comments

Comments
 (0)