Files
impala/docs/topics/impala_date.xml
Jim Apple d484d2f684 Add Apache license header to files in doc directory
This now gives a clean RAT check with bin/check-rat-report.py, which
is one way for the Impala community to check compliance with ASF rules
on intellectual property.

Change-Id: I2ad06435f84a65ba126759e42a18fdaf52cd7036
Reviewed-on: http://gerrit.cloudera.org:8080/5232
Reviewed-by: Jim Apple <jbapple-impala@apache.org>
Tested-by: Impala Public Jenkins
Reviewed-by: John Russell <jrussell@cloudera.com>
2016-12-02 23:54:32 +00:00

123 lines
4.2 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<!--
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.
-->
<!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
<concept audience="Cloudera" id="date" rev="2.0.0">
<title>DATE Data Type (<keyword keyref="impala21"/> or higher only)</title>
<prolog>
<metadata>
<data name="Category" value="Impala"/>
<data name="Category" value="Impala Data Types"/>
<data name="Category" value="SQL"/>
<data name="Category" value="Data Analysts"/>
<data name="Category" value="Developers"/>
<data name="Category" value="Dates and Times"/>
</metadata>
</prolog>
<conbody>
<p>
<indexterm audience="Cloudera">DATE data type</indexterm>
A type representing the date (year, month, and day) as a single numeric value. Used to represent a broader
date range than possible with the <codeph>TIMESTAMP</codeph> type, with fewer distinct values than
<codeph>TIMESTAMP</codeph>, and in a more compact and efficient form than using a <codeph>STRING</codeph>
such as <codeph>'2014-12-31'</codeph>.
</p>
<p conref="../shared/impala_common.xml#common/syntax_blurb"/>
<codeblock><varname>column_name</varname> DATE</codeblock>
<p>
<b>Range:</b> January 1, -4712 BC .. December 31, 9999 AD.
</p>
<p conref="../shared/impala_common.xml#common/hbase_ok"/>
<p conref="../shared/impala_common.xml#common/parquet_blurb"/>
<ul>
<li>
This type can be read from and written to Parquet files.
</li>
<li>
There is no requirement for a particular level of Parquet.
</li>
<li>
Parquet files generated by Impala and containing this type can be freely interchanged with other components
such as Hive and MapReduce.
</li>
</ul>
<p conref="../shared/impala_common.xml#common/hive_blurb"/>
<p>
TK.
</p>
<p conref="../shared/impala_common.xml#common/conversion_blurb"/>
<p>
TK.
</p>
<p conref="../shared/impala_common.xml#common/partitioning_blurb"/>
<p>
This type can be used for partition key columns. Because it has less granularity (and thus fewer distinct
values) than an equivalent <codeph>TIMESTAMP</codeph> column, and numeric columns are more efficient as
partition keys than strings, prefer to partition by a <codeph>DATE</codeph> column rather than a
<codeph>TIMESTAMP</codeph> column or a <codeph>STRING</codeph> representation of a date.
</p>
<p conref="../shared/impala_common.xml#common/compatibility_blurb"/>
<p>
This type is available on CDH 5.2 or higher.
</p>
<p conref="../shared/impala_common.xml#common/internals_2_bytes"/>
<p conref="../shared/impala_common.xml#common/added_in_20"/>
<p conref="../shared/impala_common.xml#common/column_stats_constant"/>
<p conref="../shared/impala_common.xml#common/restrictions_blurb"/>
<p>
Things happen when converting <codeph>TIMESTAMP</codeph> to <codeph>DATE</codeph> or <codeph>DATE</codeph> to
<codeph>TIMESTAMP</codeph>. TK.
</p>
<p conref="../shared/impala_common.xml#common/example_blurb"/>
<p conref="../shared/impala_common.xml#common/related_info"/>
<p>
The <xref href="impala_timestamp.xml#timestamp">TIMESTAMP</xref> data type is closely related. Some functions
from <xref href="impala_datetime_functions.xml#datetime_functions"/> accept and return <codeph>DATE</codeph>
values.
</p>
</conbody>
</concept>