default directory (/special-folder/hive/warehouse) in HDFS to store tables
directory (/special-folder/hive/warehouse/user-personal-schema) to store tables ( can be organized in schema )
directory (/special-folder/hive/warehouse/user-personal-schema/my-table-01) with zero or more files
additional sub-directory to save special data for the table
/special-folder/hive/warehouse/user-personal-schema/my-table-01/my-column-country=USA
/special-folder/hive/warehouse/user-personal-schema/my-table-01/my-column-country=GERMANY
bigsql/bin start
bigsql/bin stop
bigsql/bin status
bigsql-conf.xml
use Big SQL 1.0 into Big SQL
set syshadoop.compatability_mode=1;
- Declared type
- SQL type
- Hive type
- avoid to use string - default value 32k
- change default string length
set hadoop property bigsql.string.size=128
- use VARCHAR instead of
2003-12-23 00:00:00.0
create schema "my_schema";
use "my_schema"
drop schema "my_schema" cascade;
create hadoop table IF NOT EXISTS my_table_into_my_schema ( col1 int not null primary key, col2 varchar(50))
row format delimited
fields terminated by ','
LINES TERMINATED by '\n'
escaped BY '\\',
null defined as '%THIS_IS_NULL%' s
stored as [<empty>, TEXT, BINARY] SEQUENCEFILE;
-- PARQUETFILE
-- ORC
-- RCFILE
-- TEXTFILE
- insert values (not to use for prod) - each command will create its personal file with records
insert into my_table_into_my_schema values (1,'first'), (2,'second'), (3,'third');
- file insert - copy file into appropriate folder ( with delimiter between columns )
call syshadoop.hcat_cache_sync('my_schema', 'my_table_into_my_schema');
- create table based on select
CREATE HADOOP TABLE new_my_table STORED AS PARQUETFILE AS SELECT * FROM my_table_into_my_schema;
- load data
LOAD HADOOP USING FILE URL 'sftp://my_host:22/sub-folder/file1'
WITH SOURCE PROPERTIES ('field.delimiter' = '|')
INTO TABLE my_table_into_my_schema APPEND;
- BigSQL 1.0 - ''
- BigSQL - \N
- can be specified as part of table creation
NULL DEFINED AS 'null_representation'
CLI tool to work with any JDBC driver ( Java SQl SH )