Skip to content

Commit

Permalink
Added checks
Browse files Browse the repository at this point in the history
  • Loading branch information
osopardo1 authored and osopardo1 committed Dec 11, 2023
1 parent 52f7313 commit 7be92aa
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -182,16 +182,16 @@ object QbeastCatalogUtils {
// Process the parameters/options/configuration sent to the table
val indexedTable = tableFactory.getIndexedTable(QTableID(loc.toString))
val isNewQbeastTable = (tableType == CatalogTableType.EXTERNAL) && !indexedTable.isConverted
if (indexedTable.exists && isNewQbeastTable) {
throw AnalysisExceptionFactory.create(
"The table you are trying to create already exists and is NOT Qbeast Formatted. " +
"Please use the ConvertToQbeastCommand before creating the table.")
}
val allProperties = {
try {
checkQbeastOptions(properties)
properties // No options added
} catch {
case _: AnalysisException if (isNewQbeastTable) =>
throw AnalysisExceptionFactory.create(
"The table you are trying to create is not Qbeast Formatted. " +
"Please specify the columns to index and the cube size in the options. " +
"You can also use the ConvertToQbeastCommand before creating the table.")
case _: AnalysisException => // Add existing table properties
properties ++ indexedTable.properties // Add the write options
}
Expand Down

0 comments on commit 7be92aa

Please sign in to comment.