maropu commented on a change in pull request #28151: [SPARK-31383][SQL][DOC]
Clean up the SQL documents in docs/sql-ref*
URL: https://github.com/apache/spark/pull/28151#discussion_r405877848
##########
File path: docs/sql-ref-syntax-ddl-truncate-table.md
##########
@@ -52,47 +55,44 @@ TRUNCATE TABLE table_identifier [ partition_spec ]
</dd>
</dl>
-
### Examples
-{% highlight sql %}
---Create table Student with partition
-CREATE TABLE Student ( name String, rollno INT) PARTITIONED BY (age int);
+{% highlight sql %}
+-- Create table Student with partition
+CREATE TABLE Student (name STRING, rollno INT) PARTITIONED BY (age INT);
SELECT * from Student;
-+-------+---------+------+--+
-| name | rollno | age |
-+-------+---------+------+--+
-| ABC | 1 | 10 |
-| DEF | 2 | 10 |
-| XYZ | 3 | 12 |
-+-------+---------+------+--+
+ +----+------+---+
+ |name|rollno|age|
+ +----+------+---+
+ | ABC| 1| 10|
+ | DEF| 2| 10|
+ | XYZ| 3| 12|
+ +----+------+---+
-- Removes all rows from the table in the partition specified
TRUNCATE TABLE Student partition(age=10);
---After truncate execution, records belonging to partition age=10 are removed
+-- After truncate execution, records belonging to partition age=10 are removed
SELECT * from Student;
-+-------+---------+------+--+
-| name | rollno | age |
-+-------+---------+------+--+
-| XYZ | 3 | 12 |
-+-------+---------+------+--+
+ +----+------+---+
+ |name|rollno|age|
+ +----+------+---+
+ | XYZ| 3| 12|
+ +----+------+---+
-- Removes all rows from the table from all partitions
TRUNCATE TABLE Student;
SELECT * from Student;
-+-------+---------+------+--+
-| name | rollno | age |
-+-------+---------+------+--+
-+-------+---------+------+--+
-No rows selected
-
+ +----+------+---+
+ |name|rollno|age|
+ +----+------+---+
+ +----+------+---+
+ No rows selected
Review comment:
Ah, yes. Probably, we can remove this. Thanks!
----------------------------------------------------------------
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]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]