Files
impala/testdata/bin/create-data-source-table.sql
Matthew Jacobs 89ec6b3d7a IMPALA-1033: Remove SOURCE keyword; very common identifier
The SOURCE keyword was introduced for DATA SOURCE ddl commands, but
it is also a very common identifier. This removes the SOURCE and
SOURCES keywords and instead uses DATASOURCE and DATASOURCES.

Change-Id: Ic6c2897d1e23efa169aa8787752fe4aa2bb125d5
Reviewed-on: http://gerrit.ent.cloudera.com:8080/2895
Reviewed-by: Matthew Jacobs <mj@cloudera.com>
Tested-by: jenkins
(cherry picked from commit 267c13f9b46d249bfd1b8711fd3fadf6853dc1ef)
2014-06-09 17:17:14 -07:00

48 lines
1.5 KiB
SQL

-- Copyright 2012 Cloudera Inc.
--
-- Licensed 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.
-- Create test data sources and tables
USE functional;
DROP DATASOURCE IF EXISTS AllTypesDataSource;
CREATE DATASOURCE AllTypesDataSource
LOCATION '/test-warehouse/data-sources/test-data-source.jar'
CLASS 'com.cloudera.impala.extdatasource.AllTypesDataSource'
API_VERSION 'V1';
DROP TABLE IF EXISTS alltypes_datasource;
CREATE TABLE alltypes_datasource (
id INT,
bool_col BOOLEAN,
tinyint_col TINYINT,
smallint_col SMALLINT,
int_col INT,
bigint_col BIGINT,
float_col FLOAT,
double_col DOUBLE,
timestamp_col TIMESTAMP,
string_col STRING)
PRODUCED BY DATASOURCE AllTypesDataSource("TestInitString");
-- TODO: Remove table and move decimal cols into alltypes_datasource
DROP TABLE IF EXISTS decimal_datasource;
CREATE TABLE decimal_datasource (
d1 DECIMAL(9,0),
d2 DECIMAL(10,0),
d3 DECIMAL(20,10),
d4 DECIMAL(38,37),
d5 DECIMAL(10,5))
PRODUCED BY DATASOURCE AllTypesDataSource;