huaxingao commented on a change in pull request #28237:
URL: https://github.com/apache/spark/pull/28237#discussion_r411082047



##########
File path: docs/sql-ref-literals.md
##########
@@ -0,0 +1,505 @@
+---
+layout: global
+title: Literals
+displayTitle: Literals
+license: |
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+ 
+     http://www.apache.org/licenses/LICENSE-2.0
+ 
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+---
+
+A literal (also known as a constant) represents a fixed data value. Spark SQL 
supports the following literals:
+
+ * [String Literal](#string-literal)
+ * [Null Literal](#null-literal)
+ * [Boolean Literal](#boolean-literal)
+ * [Numeric Literal](#numeric-literal)
+ * [Datetime Literal](#datetime-literal)
+ * [Interval Literal](#interval-literal)
+
+### String Literal
+
+A string literal is used to specify a character string value.
+
+#### Syntax
+
+{% highlight sql %}
+'c [ ... ]' | "c [ ... ]"
+{% endhighlight %}
+
+#### <em>Parameters</em>
+
+<dl>
+  <dt><code><em>c</em></code></dt>
+  <dd>
+    One character from the character set. Use <code>\</code> to escape special 
characters.
+  </dd>
+</dl>
+
+#### <em>Examples</em>
+
+{% highlight sql %}
+SELECT 'Hello, World!' AS col;
+  +-------------+
+  |          col|
+  +-------------+
+  |Hello, World!|
+  +-------------+
+
+SELECT "SPARK SQL" AS col;
+  +---------+
+  |      col|
+  +---------+
+  |Spark SQL|
+  +---------+
+
+SELECT SELECT 'it\'s $10.' AS col;
+  +---------+
+  |      col|
+  +---------+
+  |It's $10.|
+  +---------+
+{% endhighlight %}
+
+### Null Literal
+
+A null literal is used to specify a null value.
+
+#### Syntax
+
+{% highlight sql %}
+NULL
+{% endhighlight %}
+
+#### Examples
+
+{% highlight sql %}
+SELECT NULL AS col;
+  +----+
+  | col|
+  +----+
+  |NULL|
+  +----+
+{% endhighlight %}
+
+### Boolean Literal
+
+A boolean literal is used to specify a boolean value.
+
+#### Syntax
+
+{% highlight sql %}
+TRUE | FALSE
+{% endhighlight %}
+
+#### Examples
+
+{% highlight sql %}
+SELECT TRUE AS col;
+  +----+
+  | col|
+  +----+
+  |true|
+  +----+
+{% endhighlight %}
+
+### Numeric Literal
+
+A numeric literal is used to specify a fixed or floating-point number.
+
+#### Integer Literal
+
+#### Syntax

Review comment:
       I prefer not to add. The font seems to small if add one more #
   <img width="825" alt="Screen Shot 2020-04-19 at 9 12 52 PM" 
src="https://user-images.githubusercontent.com/13592258/79713482-c030bb80-8282-11ea-992f-eadad975f4c2.png";>
   vs
   <img width="793" alt="Screen Shot 2020-04-19 at 9 12 06 PM" 
src="https://user-images.githubusercontent.com/13592258/79713488-c3c44280-8282-11ea-8af2-17efcb897b06.png";>
   




----------------------------------------------------------------
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:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to