Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ private[hive] class HiveClientImpl(
database.name,
database.description,
database.locationUri,
database.properties.asJava),
Option(database.properties).map(_.asJava).orNull),
ignoreIfExists)
}

Expand All @@ -311,7 +311,7 @@ private[hive] class HiveClientImpl(
database.name,
database.description,
database.locationUri,
database.properties.asJava))
Option(database.properties).map(_.asJava).orNull))
}

override def getDatabaseOption(name: String): Option[CatalogDatabase] = withHiveState {
Expand All @@ -320,7 +320,7 @@ private[hive] class HiveClientImpl(
name = d.getName,
description = d.getDescription,
locationUri = d.getLocationUri,
properties = d.getParameters.asScala.toMap)
properties = Option(d.getParameters).map(_.asScala.toMap).orNull)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is Map.empty a better default value? Or we should update the properties field in CatalogDatabase to indicate that it's nullable.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps... however this would change the semantics which was out of the scope of this ticket.

}
}

Expand Down Expand Up @@ -353,7 +353,7 @@ private[hive] class HiveClientImpl(
unsupportedFeatures += "bucketing"
}

val properties = h.getParameters.asScala.toMap
val properties = Option(h.getParameters).map(_.asScala.toMap).orNull

CatalogTable(
identifier = TableIdentifier(h.getTableName, Option(h.getDbName)),
Expand Down Expand Up @@ -390,7 +390,8 @@ private[hive] class HiveClientImpl(
outputFormat = Option(h.getOutputFormatClass).map(_.getName),
serde = Option(h.getSerializationLib),
compressed = h.getTTable.getSd.isCompressed,
serdeProperties = h.getTTable.getSd.getSerdeInfo.getParameters.asScala.toMap
serdeProperties = Option(h.getTTable.getSd.getSerdeInfo.getParameters)
.map(_.asScala.toMap).orNull
),
properties = properties,
viewOriginalText = Option(h.getViewOriginalText),
Expand Down Expand Up @@ -817,6 +818,7 @@ private[hive] class HiveClientImpl(
outputFormat = Option(apiPartition.getSd.getOutputFormat),
serde = Option(apiPartition.getSd.getSerdeInfo.getSerializationLib),
compressed = apiPartition.getSd.isCompressed,
serdeProperties = apiPartition.getSd.getSerdeInfo.getParameters.asScala.toMap))
serdeProperties = Option(apiPartition.getSd.getSerdeInfo.getParameters)
.map(_.asScala.toMap).orNull))
}
}