Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
shiyuhang0 committed Apr 3, 2024
1 parent 28dab3a commit 463436a
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ package com.pingcap.tispark.datatype
import java.sql.{Date, Timestamp}
import java.util.Calendar
import com.pingcap.tispark.datasource.BaseBatchWriteTest
import org.apache.spark.sql.Row
import org.apache.spark.sql.{AnalysisException, Row}
import org.apache.spark.sql.types._
import org.scalatest.Matchers.{be, noException, the}
import org.tikv.common.exception.TiBatchWriteException

class BatchWriteDataTypeSuite extends BaseBatchWriteTest("test_data_type", "test") {
Expand All @@ -33,7 +34,9 @@ class BatchWriteDataTypeSuite extends BaseBatchWriteTest("test_data_type", "test
jdbcUpdate(s"create table $dbtable1 (dt date)")
jdbcUpdate(s"create table $dbtable2 (dt date)")
jdbcUpdate(s"insert into $dbtable2 values ('2020-01-01')")
spark.sql(s"insert into $dbtable1 select * from $dbtable2").show()

noException should be thrownBy spark.sql(s"insert into $dbtable1 select * from $dbtable2").show()
the[AnalysisException] thrownBy spark.sql(s"insert into $dbtable1 values ('2020-01-01')").show()
}

test("Test Read different types") {
Expand Down

0 comments on commit 463436a

Please sign in to comment.