tispark icon indicating copy to clipboard operation
tispark copied to clipboard

[BUG] Insert multiple values into the column of bit type raise exception

Open lilinghai opened this issue 4 years ago • 1 comments

Describe the bug

Insert multiple values into the column of bit type raise exception

What did you do

  1. execute in tidb create table t1(a bit(64))
  2. execute in tispark
create table st using tidb options(table 't1')
insert into t1 values(2),(2) -- success
insert into t1 values('2') -- success
insert into t1 values('2'),('2') -- success
insert into t1 values('2'),(2) -- exception

What do you expect

success

What happens instead

21/01/06 04:28:23 INFO SparkExecuteStatementOperation: Running query 'insert into t1 values('2'),(2)' with 4bd44c35-c796-40f4-9fea-72a3af3d3597
21/01/06 04:28:23 ERROR SparkExecuteStatementOperation: Error executing query, currentState RUNNING,
org.apache.spark.sql.AnalysisException: incompatible types found in column col1 for inline table; line 1 pos 15
	at org.apache.spark.sql.catalyst.analysis.package$AnalysisErrorAt.failAnalysis(package.scala:42)
	at org.apache.spark.sql.catalyst.analysis.ResolveInlineTables$$anonfun$1$$anonfun$3.apply(ResolveInlineTables.scala:87)
	at org.apache.spark.sql.catalyst.analysis.ResolveInlineTables$$anonfun$1$$anonfun$3.apply(ResolveInlineTables.scala:87)

Spark and TiSpark version info

Release Version: 2.3.11 Git Commit Hash: 527ce0337d565307d4fc660a94959521f2d70445 Git Branch: release-2.3 UTC Build Time: 2020-12-17 05:46:02 Supported Spark Version: 2.3 2.4 Current Spark Version: 2.4.3 Current Spark Major Version: 2.4 TimeZone: UTC TIDB: v4.0.9

lilinghai avatar Jan 06 '21 04:01 lilinghai

/lifecycle frozen

shiyuhang0 avatar Apr 27 '22 10:04 shiyuhang0