TruncateTableCommand Logical Command

TruncateTableCommand is a logical command that represents TRUNCATE TABLE SQL statement.

Creating TruncateTableCommand Instance

TruncateTableCommand takes the following to be created:

  • TableIdentifier

  • Optional TablePartitionSpec

Executing Logical Command — run Method

run(spark: SparkSession): Seq[Row]
Note
run is part of RunnableCommand Contract to execute (run) a logical command.

run…​FIXME

run throws an AnalysisException when executed on external tables:

Operation not allowed: TRUNCATE TABLE on external tables: [tableIdentWithDB]

run throws an AnalysisException when executed on views:

Operation not allowed: TRUNCATE TABLE on views: [tableIdentWithDB]

run throws an AnalysisException when executed with TablePartitionSpec on non-partitioned tables:

Operation not allowed: TRUNCATE TABLE ... PARTITION is not supported for tables that are not partitioned: [tableIdentWithDB]

results matching ""

    No results matching ""