Skip to content

Commit 7ddaaed

Browse files
huaxingaogatorsmile
authored andcommitted
[MINOR][SQL][DOCS] Remove two leading spaces from sql tables
### What changes were proposed in this pull request? Remove two leading spaces from sql tables. ### Why are the changes needed? Follow the format of other references such as https://docs.snowflake.com/en/sql-reference/constructs/join.html, https://docs.oracle.com/cd/B19306_01/server.102/b14200/statements_10002.htm, https://www.postgresql.org/docs/10/sql-select.html. ### Does this PR introduce any user-facing change? before ``` SELECT * FROM test; +-+ ... +-+ ``` after ``` SELECT * FROM test; +-+ ... +-+ ``` ### How was this patch tested? Manually build and check Closes #28348 from huaxingao/sql-format. Authored-by: Huaxin Gao <[email protected]> Signed-off-by: gatorsmile <[email protected]> (cherry picked from commit 75da050) Signed-off-by: gatorsmile <[email protected]>
1 parent 1795a70 commit 7ddaaed

File tree

47 files changed

+2076
-2121
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+2076
-2121
lines changed

docs/sql-ref-ansi-compliance.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,11 @@ SELECT 2147483647 + 1;
7373

7474
-- `spark.sql.ansi.enabled=false`
7575
SELECT 2147483647 + 1;
76-
+----------------+
77-
|(2147483647 + 1)|
78-
+----------------+
79-
| -2147483648|
80-
+----------------+
76+
+----------------+
77+
|(2147483647 + 1)|
78+
+----------------+
79+
| -2147483648|
80+
+----------------+
8181
{% endhighlight %}
8282

8383
### Type Conversion
@@ -101,18 +101,18 @@ SELECT CAST(2147483648L AS INT);
101101

102102
-- `spark.sql.ansi.enabled=false` (This is a default behaviour)
103103
SELECT CAST('a' AS INT);
104-
+--------------+
105-
|CAST(a AS INT)|
106-
+--------------+
107-
| null|
108-
+--------------+
104+
+--------------+
105+
|CAST(a AS INT)|
106+
+--------------+
107+
| null|
108+
+--------------+
109109

110110
SELECT CAST(2147483648L AS INT);
111-
+-----------------------+
112-
|CAST(2147483648 AS INT)|
113-
+-----------------------+
114-
| -2147483648|
115-
+-----------------------+
111+
+-----------------------+
112+
|CAST(2147483648 AS INT)|
113+
+-----------------------+
114+
| -2147483648|
115+
+-----------------------+
116116

117117
-- Examples of store assignment rules
118118
CREATE TABLE t (v INT);
@@ -125,11 +125,11 @@ INSERT INTO t VALUES ('1');
125125
-- `spark.sql.storeAssignmentPolicy=LEGACY` (This is a legacy behaviour until Spark 2.x)
126126
INSERT INTO t VALUES ('1');
127127
SELECT * FROM t;
128-
+---+
129-
| v|
130-
+---+
131-
| 1|
132-
+---+
128+
+---+
129+
| v|
130+
+---+
131+
| 1|
132+
+---+
133133
{% endhighlight %}
134134

135135
### SQL Functions

docs/sql-ref-functions-udf-hive.md

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -36,22 +36,22 @@ An example below uses [GenericUDFAbs](https://github.com/apache/hive/blob/master
3636
CREATE TEMPORARY FUNCTION testUDF AS 'org.apache.hadoop.hive.ql.udf.generic.GenericUDFAbs';
3737

3838
SELECT * FROM t;
39-
+-----+
40-
|value|
41-
+-----+
42-
| -1.0|
43-
| 2.0|
44-
| -3.0|
45-
+-----+
39+
+-----+
40+
|value|
41+
+-----+
42+
| -1.0|
43+
| 2.0|
44+
| -3.0|
45+
+-----+
4646

4747
SELECT testUDF(value) FROM t;
48-
+--------------+
49-
|testUDF(value)|
50-
+--------------+
51-
| 1.0|
52-
| 2.0|
53-
| 3.0|
54-
+--------------+
48+
+--------------+
49+
|testUDF(value)|
50+
+--------------+
51+
| 1.0|
52+
| 2.0|
53+
| 3.0|
54+
+--------------+
5555
{% endhighlight %}
5656

5757

@@ -63,22 +63,22 @@ CREATE TEMPORARY FUNCTION hiveUDTF
6363
AS 'org.apache.hadoop.hive.ql.udf.generic.GenericUDTFExplode';
6464

6565
SELECT * FROM t;
66-
+------+
67-
| value|
68-
+------+
69-
|[1, 2]|
70-
|[3, 4]|
71-
+------+
66+
+------+
67+
| value|
68+
+------+
69+
|[1, 2]|
70+
|[3, 4]|
71+
+------+
7272

7373
SELECT hiveUDTF(value) FROM t;
74-
+---+
75-
|col|
76-
+---+
77-
| 1|
78-
| 2|
79-
| 3|
80-
| 4|
81-
+---+
74+
+---+
75+
|col|
76+
+---+
77+
| 1|
78+
| 2|
79+
| 3|
80+
| 4|
81+
+---+
8282
{% endhighlight %}
8383

8484
Hive has two UDAF interfaces: [UDAF](https://github.com/apache/hive/blob/master/udf/src/java/org/apache/hadoop/hive/ql/exec/UDAF.java) and [GenericUDAFResolver](https://github.com/apache/hive/blob/master/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDAFResolver.java).
@@ -90,19 +90,19 @@ CREATE TEMPORARY FUNCTION hiveUDAF
9090
AS 'org.apache.hadoop.hive.ql.udf.generic.GenericUDAFSum';
9191

9292
SELECT * FROM t;
93-
+---+-----+
94-
|key|value|
95-
+---+-----+
96-
| a| 1|
97-
| a| 2|
98-
| b| 3|
99-
+---+-----+
93+
+---+-----+
94+
|key|value|
95+
+---+-----+
96+
| a| 1|
97+
| a| 2|
98+
| b| 3|
99+
+---+-----+
100100

101101
SELECT key, hiveUDAF(value) FROM t GROUP BY key;
102-
+---+---------------+
103-
|key|hiveUDAF(value)|
104-
+---+---------------+
105-
| b| 3|
106-
| a| 3|
107-
+---+---------------+
102+
+---+---------------+
103+
|key|hiveUDAF(value)|
104+
+---+---------------+
105+
| b| 3|
106+
| a| 3|
107+
+---+---------------+
108108
{% endhighlight %}

0 commit comments

Comments
 (0)