Skip to content

Commit

Permalink
[CARBONDATA-4058]create or insert data into the carbon table through …
Browse files Browse the repository at this point in the history
…Hive throw NPE
  • Loading branch information
liyong072 committed Dec 15, 2020
1 parent afb7626 commit 2339d75
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class CarbonHiveMetastoreListener(conf: Configuration) extends MetaStorePreEvent
val table = preEventContext.asInstanceOf[PreCreateTableEvent].getTable
val tableProps = table.getParameters
if (tableProps != null
&& tableProps.containsKey("spark.sql.sources.provider")
&& (tableProps.get("spark.sql.sources.provider") == "org.apache.spark.sql.CarbonSource"
|| tableProps.get("spark.sql.sources.provider").equalsIgnoreCase("carbondata"))) {
val numSchemaParts = tableProps.get("spark.sql.sources.schema.numParts")
Expand Down Expand Up @@ -65,6 +66,7 @@ class CarbonHiveMetastoreListener(conf: Configuration) extends MetaStorePreEvent
val table = preEventContext.asInstanceOf[PreAlterTableEvent].getNewTable
val tableProps = table.getParameters
if (tableProps != null
&& tableProps.containsKey("spark.sql.sources.provider")
&& (tableProps.get("spark.sql.sources.provider") == "org.apache.spark.sql.CarbonSource"
|| tableProps.get("spark.sql.sources.provider").equalsIgnoreCase("carbondata"))) {
val numSchemaParts = tableProps.get("spark.sql.sources.schema.numParts")
Expand Down

0 comments on commit 2339d75

Please sign in to comment.