mirror of
https://github.com/apache/impala.git
synced 2025-12-26 14:02:53 -05:00
The schema file allows specifying a commandline command in several of the sections (LOAD, DEPENDENT_LOAD, etc). These are execute by testdata/bin/generate-schema-statements.py when it is creating the SQL files that are later executed for dataload. A fair number of tables use this flexibility to execute hdfs mkdir and copy commands via the command line. Unfortunately, this is very inefficient. HDFS command line commands require spinning up a JVM and can take over one second per command. These commands are executed during a serial part of dataload, and they can be executed multiple times. In short, these commands are a significant slowdown for loading the functional tables. This converts the hdfs command line statements to equivalent Hive LOAD DATA LOCAL statements. These are doing the copy from an already running JVM, so they do not need JVM startup. They also run in the parallel part of dataload, speeding up the SQL generation part. This speeds up generate-schema-statements.py significantly. On the functional dataset, it saves 7 minutes. Before: time testdata/bin/generate-schema-statements.py -w functional-query -e exhaustive -f real 8m8.068s user 10m11.218s sys 0m44.932s After: time testdata/bin/generate-schema-statements.py -w functional-query -e exhaustive -f real 0m35.800s user 0m42.536s sys 0m5.210s This is currently a long-pole in dataload, so it translates directly to an overall speedup of about 7 minutes. Testing: - Ran debug tests Change-Id: Icf17b85ff85618933716a80f1ccd6701b07f464c Reviewed-on: http://gerrit.cloudera.org:8080/15228 Reviewed-by: Joe McDonnell <joemcdonnell@cloudera.com> Tested-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com>
This directory contains Impala test data sets. The directory layout is structured as follows:
datasets/
<data set>/<data set>_schema_template.sql
<data set>/<data files SF1>/data files
<data set>/<data files SF2>/data files
Where SF is the scale factor controlling data size. This allows for scaling the same schema to
different sizes based on the target test environment.
The schema template SQL files have the following format:
The goal is to provide a single place to define a table + data files
and have the schema and data load statements generated for each combination of file
format, compression, etc. The way this works is by specifying how to create a
'base table'. The base table can be used to generate tables in other file formats
by performing the defined INSERT / SELECT INTO statement. Each new table using the
file format/compression combination needs to have a unique name, so all the
statements are pameterized on table name.
The template file is read in by the 'generate_schema_statements.py' script to
to generate all the schema for the Imapla benchmark tests.
Each table is defined as a new section in the file with the following format:
====
---- SECTION NAME
section contents
...
---- ANOTHER SECTION
... section contents
---- ... more sections...
Note that tables are delimited by '====' and that even the first table in the
file must include this header line.
The supported section names are:
DATASET
Data set name - Used to group sets of tables together
BASE_TABLE_NAME
The name of the table within the database
CREATE
Explicit CREATE statement used to create the table (executed by Impala)
CREATE_HIVE
Same as the above, but will be executed by Hive instead. If specified,
'CREATE' must not be specified.
CREATE_KUDU
Customized CREATE TABLE statement used to create the table for Kudu-specific
syntax.
COLUMNS
PARTITION_COLUMNS
ROW_FORMAT
HBASE_COLUMN_FAMILIES
TABLE_PROPERTIES
HBASE_REGION_SPLITS
If no explicit CREATE statement is provided, a CREATE statement is generated
from these sections (see 'build_table_template' function in
'generate-schema-statements.py' for details)
ALTER
A set of ALTER statements to be executed after the table is created
(typically to add partitions, but may also be used for other settings that
cannot be specified directly in the CREATE TABLE statement).
These statements are ignored for HBase and Kudu tables.
LOAD
The statement used to load the base (text) form of the table. This is
typically a LOAD DATA statement.
DEPENDENT_LOAD
DEPENDENT_LOAD_KUDU
DEPENDENT_LOAD_HIVE
Statements to be executed during the "dependent load" phase. These statements
are run after the initial (base table) load is complete.
HIVE_MAJOR_VERSION
The required major version of Hive for this table. If the major version
of Hive at runtime does not exactly match the version specified in this section,
the table will be skipped.
NOTE: this is not a _minimum_ version -- if HIVE_MAJOR_VERSION specifies '2',
the table will _not_ be loaded/created on Hive 3.