MaxGekk commented on a change in pull request #32018:
URL: https://github.com/apache/spark/pull/32018#discussion_r605662843
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/PartitioningUtils.scala
##########
@@ -350,7 +350,12 @@ object PartitioningUtils {
*/
def getPathFragment(spec: TablePartitionSpec, partitionSchema: StructType):
String = {
partitionSchema.map { field =>
- escapePathName(field.name) + "=" + escapePathName(spec(field.name))
+ val value = if (spec(field.name) == null || spec(field.name).isEmpty) {
Review comment:
Can we re-use existing function or if not, could you extract common code?
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/PartitioningUtils.scala
##########
@@ -350,7 +350,12 @@ object PartitioningUtils {
*/
def getPathFragment(spec: TablePartitionSpec, partitionSchema: StructType):
String = {
partitionSchema.map { field =>
- escapePathName(field.name) + "=" + escapePathName(spec(field.name))
+ val value = if (spec(field.name) == null || spec(field.name).isEmpty) {
+ DEFAULT_PARTITION_NAME
+ } else {
+ escapePathName(spec(field.name))
Review comment:
Probably, look up time to `spec` is not big deal but I would store
`spec(field.name)` to a val.
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]