Obsolete

This page is obsolete. It has been replaced with http://trafodion.apache.org/documentation.html

Redirection Notice

This page will redirect to http://trafodion.apache.org/documentation.html.

The first release of Trafodion provides an operational SQL engine on top of Hadoop. Features include:

  • Fully functional ANSI SQL language support
  • Full ACID support for read/write queries including distributed transaction protection for multiple rows, tables, and statements
  • Heterogeneous storage engine access including native access to data stores
  • Enhanced High Availability support for client applications
  • Support for large data sets using optimized intra-query parallelism
  • Performance improvements for OLTP workloads via compile and runtime optimizations

Transaction management features include:

  • Transaction serializability using the HBase-Trx implementation of Multi-Version Concurrency Control
  • Transaction recovery to achieve database consistency
  • Thread-aware transaction management support to work with multi-threaded SQL clients
  • Non-transactional/direct access to HBase tables

The sections below give more details.

Key Features

SQL Data Definition Language (DDL) Statements

StatementDescription
CREATE SCHEMAThis statement runs but does not actually create a schema. A schema is created when you qualify the table name with a new schema name in a CREATE TABLE statement.
CREATE TABLECreates a table; includes support for variations like CREATE TABLE AS, CREATE TABLE LIKE, and CREATE VOLATILE TABLE
CREATE INDEXCreates an index on an existing table.
CREATE VIEWCreates a view.
CREATE FUNCTIONCreates a user-defined function (UDF) written in C.
CREATE PROCEDURECreates a stored procedure written in Java (SPJ).
CREATE LIBRARYCreates a library object for an SPJ's JAR file or a UDF's library file in the database schema.
DROP TABLEDrops a table; includes support for both RESTRICT and CASCADE options.
DROP INDEXDrops an index.
DROP VIEWDrops a view.
DROP FUNCTIONDrops a user-defined function (UDF) written in C.
DROP PROCEDUREDrops a stored procedure written in Java (SPJ).
DROP LIBRARYDrops a library object for SPJs or UDFs from the database schema.
ALTER TABLEAlters table by adding or removing columns to an existing table.

SQL Data Manipulation Language (DML) Statements

Both read (SELECT) and write (INSERT/UPDATE/DELETE) statements are supported. The CALL statement (for invoking Java stored procedures) is also supported.

SELECT Statement

FeatureDescription
SELECT listCardinality can be specified using ANY, FIRST, ALL clauses. DISTINCT clause is supported to remove duplicates. Multiple DISTINCT clauses are supported. Column names can reference correlated names.
FROM clauseCan include table or view references. Joins can be natural or cross product joins. Following join types are supported:
  • INNER
  • LEFT OUTER
  • RIGHT OUTER
  • FULL OUTER
WHERE clauseAllows user to specify search condition to select rows.
Subquery supportSubquery allowed as part of search condition. Supported as both nested as well as correlated.
GROUP BY clauseAllows user to return the rows in grouping columns that define groups. Both column names and ordinals are allowed.
HAVING clauseAllows user to specify a search condition to apply to each group resulting from GROUP BY clause.
ORDER BY clauseAllows user to specify ordering for the rows returned. Both column names and ordinals are allowed.
UNION clauseAllows users to merge result output from two SELECT statements.
SAMPLE clauseTrafodion extension that allows user to select a subset of rows from result table.
TRANSPOSE clauseTrafodion extension that allows users functionality similar to Pivot command in Oracle and SQL server products.
SEQUENCE BY clauseTrafodion extension to specify the sort order for result table for calculating sequence functions.

INSERT/UPDATE/DELETE Statements

StatementDescription
INSERTInserts data into tables and views.
UPDATEUpdates values of columns of a table or view.
DELETEDeletes rows from a table or view.
UPSERTUpdates a table if the row exists and inserts into a table if the row does not exist.
MERGEPerforms UPSERT and additionally updates matching rows from one table to another.

CALL Statement

StatementDescription
CALLCalls a stored procedure in Java (SPJ).

SQL Transaction Control Statements

StatementDescription
BEGIN WORKStarts a transaction.
COMMIT WORKCommits any changes and ends the transaction.
ROLLBACK WORKUndoes any changes and ends the transaction.
SET TRANSACTIONSets attributes for the next transaction.

SQL Data Types

The CAST function can be used to convert values from one data type to another.

Data TypeDescription
NumericSupport for the following numeric data types:
  • NUMERIC
  • BIGNUM (extended numeric precision implemented in software)
  • SMALLINT
  • INTEGER
  • LARGEINT
  • FLOAT
CharacterSupport for the following string data types:
  • CHAR
  • VARCHAR

Character data type support includes international character set support.

Date/timeSupport for the following data types:
  • DATE
  • TIME
  • TIMESTAMP
IntervalINTERVAL

SQL Language Feature Support

FeatureDescription
Character setsISO88591, UTF8, and UCS2 character sets are supported for user data. Metadata is stored using UTF8 encoding. The TRANSLATE function supports translation of a character string between compatible character sets.
ConstraintsPrimary key, not null, check, and unique constraints are supported. Foreign key constraints (referential integrity) are also supported.
Correlation namesCorrelation names for tables, views, or subqueries are supported.
CursorsSupport for non-holdable cursors only.
ExpressionsSupport for data-type–based value expressions.
IdentifiersSupport for both regular and delimited identifiers.
KeysSupport for primary keys (but primary keys cannot be dropped), clustering keys, and hash partition keys. Additionally, a system-generated syskey can be used as key.
LiteralsSupport for data-type–based literals.
PredicatesSupport for following types of predicates:

BETWEENComparison operatorsEXISTSINLIKEIS [NOT] NULLQuantified comparison operators

SubquerySupport for nested and correlated subqueries.

SQL Clauses

Clause TypeDescription
DEFAULTAllows a default value for a column in a CREATE TABLE or ALTER TABLE ADD COLUMN statement.
FORMATAllows one to specify the output format of a column.

SQL Functions

Function typeDescriptionDetails
AggregatesAggregate functionsSupported functions:

AVG, COUNT, MAX, MIN, STDDEV, SUM, VARIANCE

CharacterCharacter string functions on character data type valuesSupported functions:

ASCII, CHAR, CHAR_LENGTH, CODE_VALUE, CONCAT, INSERT, LCASE, LEFT, LOCATE, LOWER, LPAD, LTRIM, OCTET_LENGTH, POSITION, REPEAT, REPLACE, RIGHT, RPAD, RTRIM, SPACE, SUBSTRING/SUBSTR, TRANSLATE, TRIM, UCASE, UPPER, UPSHIFT

Date/timeTime-related functions on date/timestamp data typeSupported functions:

ADD_MONTHS, CONVERTTIMESTAMP, CURRENT, CURRENT_DATE, CURRENT_TIME, CURRENT_TIMESTAMP, DATE_ADD, DATE_PART, DATE_SUB, DATE_TRUNC, DATEADD, DATEDIFF, DATEFORMAT, DAY, DAYNAME, DAYOFMONTH, DAYOFWEEK, DAYOFYEAR, EXTRACT, HOUR, JULIANTIMESTAMP, MINUTE, MONTH, MONTHNAME, QUARTER, SECOND, TIMESTAMPADD, TIMESTAMPDIFF, WEEK, YEAR

MathematicalMath and statistical functions on numerical data typeSupported functions:

ABS, ACOS, ASIN, ATAN, ATAN2, CEILING, COS, COSH, DEGRESS, EXP, FLOOR, LOG, LOG10, MOD, NULLIFZERO, PI, POWER, RADIANS, SIGN, SIN, SINH, SQRT, TAN, TANH, ZEROIFNULL

SequenceTrafodion extension that provides a subset of aggregate functions on an intermediate table of ordered rowsSupported functions:
  • DIFF1, DIFF2
  • MOVINGAVG, MOVINGCOUNT, MOVINGMAX, MOVINGMIN, MOVINGSTDDEV, MOVINGSUM, MOVINGVARIANCE
  • OFFSET, RANK
  • RUNNINGAVG, RUNNINGCOUNT, RUNNINGMAX, RUNNINGMIN, RUNNINGRANK, RUNNINGSTDDEV, RUNNINGSUM, RUNNINGVARIANCE
  • LASTNOTNULL, ROWS SINCE, ROWS SINCE CHANGED, THIS
MiscellaneousUtility functions related to NULL, security, data type conversion, and so on.Supported functions:

BITAND, CASE, CAST, COALESCE, CONVERTTOHEX, CURRENT_USER, DECODE, EXPLAIN, ISNULL, NULLIF, NVL, SESSION_USER, USER

User-defined functionsUser-defined functions (UDFs) written in C are supported.Functions may return scalar values, rows, or tables.

SQL Utilities

StatementDescription
UPDATE STATISTICSTrafodion extension that updates the histogram statistics for one or more groups of columns within a table
EXPLAINTrafodion extension function that generates a result table describing the access plan for a DML statement
CONTROL QUERY DEFAULTTrafodion extension that allows users to change the default settings for the current process
CONTROL QUERY SHAPETrafodion extension that allows users to influence the optimizer in picking either a fragment or complete query plan of the user's choice

Trafodion Limits

ItemLimit Description
NamesSchema, table, columns names are limited to 256 bytes. (However, many UTF8 characters will fit in 256 bytes.)
TableNo set limit for maximum length for a row
IndexesNo set limit for combined length of columns in an index key
ConstraintsNo set limit for combined length of columns in a PRIMARY KEY
VARCHARColumn length of up to 100 KB is supported.
  • No labels