jackye1995 commented on a change in pull request #3035:
URL: https://github.com/apache/iceberg/pull/3035#discussion_r699959277



##########
File path: 
aws/src/main/java/org/apache/iceberg/aws/dynamodb/DynamoDbCatalog.java
##########
@@ -248,7 +248,7 @@ public boolean dropNamespace(Namespace namespace) throws 
NamespaceNotEmptyExcept
       dynamo.deleteItem(DeleteItemRequest.builder()
           .tableName(awsProperties.dynamoDbTableName())
           .key(namespacePrimaryKey(namespace))
-          .conditionExpression("attribute_exists(" + namespace + ")")
+          .conditionExpression("attribute_exists(" + 
DynamoDbCatalog.COL_NAMESPACE + ")")

Review comment:
       yes you are right, it was used to prevent calling the same method twice, 
but it likely does not matter given it's dropping the namespace. Thanks for 
noticing this bug, somehow I did not have a drop namesapce test. I will add it 
in another PR.

##########
File path: 
aws/src/main/java/org/apache/iceberg/aws/dynamodb/DynamoDbCatalog.java
##########
@@ -248,7 +248,7 @@ public boolean dropNamespace(Namespace namespace) throws 
NamespaceNotEmptyExcept
       dynamo.deleteItem(DeleteItemRequest.builder()
           .tableName(awsProperties.dynamoDbTableName())
           .key(namespacePrimaryKey(namespace))
-          .conditionExpression("attribute_exists(" + namespace + ")")
+          .conditionExpression("attribute_exists(" + 
DynamoDbCatalog.COL_NAMESPACE + ")")

Review comment:
       nit: `COL_NAMESPACE` instead of `DynamoDbCatalog.COL_NAMESPACE`

##########
File path: 
aws/src/main/java/org/apache/iceberg/aws/dynamodb/DynamoDbCatalog.java
##########
@@ -248,7 +248,7 @@ public boolean dropNamespace(Namespace namespace) throws 
NamespaceNotEmptyExcept
       dynamo.deleteItem(DeleteItemRequest.builder()
           .tableName(awsProperties.dynamoDbTableName())
           .key(namespacePrimaryKey(namespace))
-          .conditionExpression("attribute_exists(" + namespace + ")")
+          .conditionExpression("attribute_exists(" + 
DynamoDbCatalog.COL_NAMESPACE + ")")

Review comment:
       yes you are right, it was used to prevent calling the same method twice, 
but it likely does not matter given it's dropping the namespace. We can address 
that separately. Thanks for noticing this bug, somehow I did not have a drop 
namesapce test.




-- 
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]

Reply via email to