File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
sql/core/src/test/scala/org/apache/spark/sql/connector Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -2469,11 +2469,15 @@ class DataSourceV2SQLSuite
2469
2469
|CREATE TABLE $t (id bigint, city string, data string)
2470
2470
|USING foo
2471
2471
|PARTITIONED BY (id, city) """ .stripMargin)
2472
- sql(s " INSERT INTO $t PARTITION(id = 1, city = 'NY') SELECT 'abc' " )
2473
-
2474
2472
val partTable = catalog(" testpart" ).asTableCatalog
2475
2473
.loadTable(Identifier .of(Array (" ns1" , " ns2" ), " tbl" )).asInstanceOf [InMemoryPartitionTable ]
2476
- assert(partTable.partitionExists(InternalRow .fromSeq(Seq (1 , UTF8String .fromString(" NY" )))))
2474
+ val expectedPartitionIdent = InternalRow .fromSeq(Seq (1 , UTF8String .fromString(" NY" )))
2475
+ assert(! partTable.partitionExists(expectedPartitionIdent))
2476
+ sql(s " INSERT INTO $t PARTITION(id = 1, city = 'NY') SELECT 'abc' " )
2477
+ assert(partTable.partitionExists(expectedPartitionIdent))
2478
+ // Insert into the existing partition must not fail
2479
+ sql(s " INSERT INTO $t PARTITION(id = 1, city = 'NY') SELECT 'def' " )
2480
+ assert(partTable.partitionExists(expectedPartitionIdent))
2477
2481
}
2478
2482
}
2479
2483
You can’t perform that action at this time.
0 commit comments