cloud-fan commented on code in PR #47660:
URL: https://github.com/apache/spark/pull/47660#discussion_r1711570485
##########
sql/core/src/test/scala/org/apache/spark/sql/connector/TestV2SessionCatalogBase.scala:
##########
@@ -71,18 +71,28 @@ private[connector] trait TestV2SessionCatalogBase[T <:
Table] extends Delegating
properties: java.util.Map[String, String]): Table = {
import
org.apache.spark.sql.connector.catalog.CatalogV2Implicits.IdentifierHelper
val key = TestV2SessionCatalogBase.SIMULATE_ALLOW_EXTERNAL_PROPERTY
- val propsWithLocation = if (properties.containsKey(key)) {
- // Always set a location so that CREATE EXTERNAL TABLE won't fail with
LOCATION not specified.
- if (!properties.containsKey(TableCatalog.PROP_LOCATION)) {
+ val updatedProps =
+ if (properties.containsKey(TableCatalog.PROP_LOCATION)) {
val newProps = new java.util.HashMap[String, String]()
newProps.putAll(properties)
- newProps.put(TableCatalog.PROP_LOCATION, "file:/abc")
+ newProps.put(TableCatalog.PROP_EXTERNAL, "true")
newProps
} else {
properties
}
+
+ val propsWithLocation = if (updatedProps.containsKey(key)) {
+ // Always set a location so that CREATE EXTERNAL TABLE won't fail with
LOCATION not specified.
+ if (!updatedProps.containsKey(TableCatalog.PROP_LOCATION)) {
+ val newProps = new java.util.HashMap[String, String]()
Review Comment:
we only need to create a new hash map once.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]