ExExeUtil.h

Clone Tools
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Merge PR 1417 [TRAFODION-2917] Refactor Trafodion implementation of hdfs scan for text formatted hive tables

  1. … 9 more files in changeset.
New syntax to retrieve the LOB HDFS filename for both external and internal LOBs . Also added syntax to return starting offset of a particular LOB handle in the LOB Hdfs data file.

  1. … 15 more files in changeset.
[TRAFODION-2917] Refactor Trafodion implementation of hdfs scan for text formatted hive tables

Part-1 changes.

Created a new class org.trafodion.sql.HDFSClient. Any direct HDFS access

will be routed to this class via JNI instead of using libhdfs.

Modified the existing code expect for the following to route the HDFS request via this class

1. LOB access

2. Direct HDFS scan of the table

3. Sample data creation during update stats

Added a new class org.trafodio.sql.HdfsScan for scanning one or many ranges of a Hive

text formatted table. This class will be used for Direct HDFS scan in near future.

  1. … 21 more files in changeset.
TRAFODION-2873. Fix for avoiding cores during expression eval for inserts into LOB tables. The fix involves cleaning up the LOBGlibals and eliminating unneeded datamemebers and keeping only the ExLobGlobals members. Also cleaned up all LobLoad related code since it is obsolete and worked only with DP2.

Conflicts:

core/sql/executor/ExExeUtilLoad.cpp

  1. … 9 more files in changeset.
[TRAFODION-2420] RMS enhancements

The float type counters such as Estimated Accesssed Rows, Estimated Rows used and

Estimated Memory are not formatted correctly after sprintf changes.

This resulted in RMS output to be messed up making it diffcult to read and analyze

the output.

(cherry picked from commit 41c0ca7067c1e0097c05e1c823ea26eb2a828591)

  1. … 1 more file in changeset.
[TRAFODION-2768] Make Trafodion code base to compile in RH7

  1. … 126 more files in changeset.
TRAFODION-2731 CodeCleanup: Remove obsolete, legacy and unused code

This phase handles the following:

-- removal of code that dealt with:

-- mpalias, NSK, MP, mploc, resource fork, rfork

-- ARLIB, DISK, VOLUME, PFS, compiler version info

-- interpretasrow/IAR, AuditImage, ExtractColumns functions

-- ARKCMP_SINGLE_PROCESS and oneProcess()

-- recompControl, remoteDefaults, rtdu, module

-- latebind thru nsk defines, guardian names, nametype nsk

-- SHADOW implementation

-- MEASURE

-- older sqlcat ReadTableDef

-- DP2_MEMORY, DP2_SPACE, HGB_DP2_MEMORY_LIMIT

-- internal cli methods no longer used by any caller

Code within the following defines is removed if it is obsolete

or the define itself is removed if that feature is always on:

-- removed NA_EIDPROC

-- removed SQLEXP_LIB_FUNC

-- removed NA_CMPDLL

-- removed SQ_PHANDLE_VERIFIER

-- removed SQ_NEW_PHANDLE

-- removed __EID

-- removed ARKFS_OPEN

-- removed STAND_ALONE

-- removed __TANDEM

-- removed NA_C89

-- removed NA_NSK

-- removed SQLEXPORT_LIB_FUNC

-- removed SQLCLI_LIB_FUNC

-- removed CLI_PRIV_SRL

-- removed PRIV_SRL

-- removed NA_LINUX

-- removed NA_HSC_LINUX

-- removed NA_UNIX

-- removed NA_WINNT

-- removed HAVE_MMAP

-- removed NA_NO_C_RUNTIME

-- removed NA_DEBUG_C_RUNTIME(replaced with _DEBUG)

-- removed NA_64BIT usage except in sqlcli.h

-- removed dg64

-- removed SQLEXPORT_LIB

-- removed NA_ARKFS

-- removed NA_IEEE_FLOAT

-- removed NA_GUARDIAN_MSG

-- removed NA_HSC

-- removed NA_TMFNOTYETSUPPORTED

-- removed ERROR

-- removed ERROR_STATE

-- removed SQLERRORS_LIB_FUNC

Contents of these files have been removed.

Next checkin fill remove the files itself from git:

executor/dmeasql.h

executor/ExMeas.h, ExMeas.cpp

executor/tempfile.h, .cpp

executor/rcb.h

executor/stubs.cpp, stubs2.cpp

exp/srlversion.cpp

cli/rtdu.h, rtdu2.h, rtdu.cpp, rtdu.cpp

cli/VicKeyValuePair.h

cli/CliDll.cpp

cli/CliStubsStaticBuild.cpp

cli/globalsrlversion.cpp

cli/globalstubs.cpp

cli/sqlciSRLStubs.cpp

cli/test.cpp

cli/privsrlversion.cpp

common/SqlExpDllDefines.h

common/SqlExportDllDefines.h

sqlcat/enum.h

sqlcat/ReadTableDef.h, cpp

sqlcat/readRealArk.h, cpp

  1. … 460 more files in changeset.
Merge remote branch 'origin/pr/1216/head' into merge_1216

  1. … 11 more files in changeset.
Main change:

Added a method for JDBC driver to be able to close an open cursor abruptly by passing in a 0 length to the extract syntax. This will ensure internal opens are not left around if the application does not retrieve all the data with the stream API.

This abrupt close can be called when the result set is closed or the connection is closed by keeping track of all the open Blob objects. (in the driver)

Added a freeResources method and destructor to LobExtract and LobUpdate Tcbs.

Minor changes and fixes :

Refactored the ExLob::closeCursor

Removed the LOB_CLI_SELECT_CLOSE call from ::fetchCursor so it gets closed only when ExLob::closeCursor is called. Makes the code consistent and readable.

Took care of a few memory allocations and deletions.

Refactored the LOB length calculation into on ecommon method so it works correctly for both regular LOB dat aas well as external LOB files. Earlier the external lobs length was being returned incorrectly. Now it reports the length of the external HDFS file .

Fixed one place in generator where the CQD value was not being multiplied by the MB units correctly.

  1. … 10 more files in changeset.
Changes to take care of closing internal cursor statement when extract operation is done and the exact length of data is passed in to be extracted.

  1. … 2 more files in changeset.
TRAFODION-2683 add a new explain option to mask variant fields in output

--Syntax extension to cleanse and mask:

explain options 'c' select ...

explain options 'fc' select...

prepare s from select ...

explain option 'c' s;

--Masked fields will show up as "###" in explain output.

--Both option and options keyword can be used in explain and showplan.

-- explain option/options ...

-- showplan option/options ...

-- showplan can be used on explain statement.

-- Here is an example of what the output will look like:

>>explain option 'c' select * from dual;

----------------------------------------------- PLAN SUMMARY

MODULE_NAME .............. DYNAMICALLY COMPILED

STATEMENT_NAME ........... NOT NAMED

PLAN_ID ................ ###

ROWS_OUT ............... ###

EST_TOTAL_COST ......... ###

STATEMENT ................ select * from dual;

------------------------------------------- NODE LISTING

ROOT ================================ SEQ_NO 2 ONLY CHILD 1

REQUESTS_IN ............ ###

ROWS_OUT ............... ###

EST_OPER_COST .......... ###

EST_TOTAL_COST ......... ###

DESCRIPTION

max_card_est ......... ###

fragment_id ............ 0

parent_frag ............ (none)

fragment_type .......... master

statement_index ........ 0

affinity_value ....... ###

max_max_cardinality ###

total_overflow_size ###

xn_access_mode ......... read_only

xn_autoabort_interval 0

auto_query_retry ....... enabled

plan_version ....... 2,600

embedded_arkcmp ........ used

select_list ............ %(0)

input_variables ........ %(0), %(0), %(0)

VALUES ======================== SEQ_NO 1 NO CHILDREN

REQUESTS_IN ............ ###

ROWS_OUT ............... ###

EST_OPER_COST .......... ###

EST_TOTAL_COST ......... ###

DESCRIPTION

max_card_est ......... ###

fragment_id ............ 0

parent_frag ............ (none)

fragment_type .......... master

tuple_expr ............. %(0)

--- SQL operation complete.

>>

  1. … 21 more files in changeset.
Merge PR 1143 Fix for [TRAFODION-2654] and [TRAFODION-2653]

TRAFODION [2641] User who has MANAGE_STATISTICS privilege can't do update statistics on HIVE tables

TRAFODION [2175] a user should only see specific schemas/tables that he has

privileges to

Updated the following get commands:

get schemas (in catalog)

get tables, indexes (in schema)

get sequences, views (in schema, in catalog)

get libraries, procedures, functions, table mapping functions

TRAFODION [1573] Additional GET commands for privileges

get privileges on table

get privileges on view

New regression test privs1/TEST125

Fixed bug: user granted MANAGE privilege does not have MANAGE sub-privs

Changed REGISTER_HIVE_OBJECT to be treated as a sub-priv under CREATE

Changed UNREGISTER_HIVE_OBJECT to be treaed as a sub-priv under DROP

  1. … 6 more files in changeset.
[TRAFODION-2654] Change the location of trafodion-site.xml from $TRAF_HOME/etc to config [TRAFODION-2653] Sort operator loops at times

All HBase client connections from Trafodion uses Trafodion configuration

concept. Any client side property can now be set in trafodion-site.xml.

The scratch files are now open in blocking mode. Hence any scratch file

operation shouldn't return EAGAIN.

The internal table TDDL of table is now created without any table

coprocessors attached to it.

  1. … 23 more files in changeset.
[TRAFODION-2420] RMS enhancements

New counters introduced as part of BMO

InterimRowCount - Counter to keep track intermediate rows

produced by hash join and for intermediate

runs in sort

phase - BMO Phase for hash-join and sort

get statistics for statement s1, options 'cs' now works.

Removed attaching BMO stats to Non-root Paritial and leaf partition hash group by operators.

These operators are non-blocking BMOs.

Introduced 3 phases for hash grby operator to be visible in RMS Stats

options 'sl' now works with get statistics for qid.

The relevant new counters are now part of accumulated statistics type.

Extended the support upto 512 opeartors from 256 operators in RMS

Fixed both Type 2 and mxosrvr code to obtain all the externalized counters in accumualted stats correctly.

  1. … 27 more files in changeset.
[TRAFODION-2584] Add support to register hive objects in traf metadata

Syntax:

register hive table/view [if not exists] <object-name> [cascade]

unregister hive table/view [if exists] <object-name> [cascade]

cascade option: register/unregister all underlying objects that are

part of the specified view

update statistics, grant/revoke, traf views or external table creation

on hive objects will automatically and internally register those objects

in trafodion metadata.

invoke/showddl will show if this object is registered and whether

that registration was internal or explicit.

Get command extensions:

get hive registered tables/view/objects in catalog trafodion;

get hive external tables in catalog trafodion;

Cleanup command extensions:

cleanup metadata command will clean up inconsistent hive objects

(underlying hive object is missing but object is registered or

an external table exists)

cleanup [hive table | hive view] on <object-name>;

Existing hive objects that had implicit or explicit external tables

created prior to this checkin will have no change in behavior.

ObjectUID of those external tables will continue to be used for

relevant operations.

One can drop those external tables and explicitly register them,

or a subsequent operation(upd stats, grant, etc) that needs objectUID will

automatically register them.

minor changes based on review comments of previous checkin

get all objects command on hive metadata no longer fails.

get views on objects return 3-part name that could be used to

differentiate between a traf and hive view.

regress/hive/TEST007 has been extended.

TBD: Add register/unregister privileges

  1. … 52 more files in changeset.
[TRAFODION-2420] RMS enhancements Introduced 2 new counters HeapWM: - "SQL Heap WM" - Tracks the high water mark of the used memory including space buffer and bmo operator memory. It is enough to monitor this counter alone to track the memory utilization of the query.

scrIOTime: "Scr. IO Time" - Tracks the IO time taken to read/write to

the scratch files at BMO operator level

Introduced a 'Single line Format' option to display BMO stats and SE stats

in a single line format to enable exporting the output to Excel easily.

GET STATISTICS FOR QID CURRENT PROGRESS, OPTIONS 'SL'

Removed and cleaned up the code further

Also fixed memory corruption issues seen with GET STATISTICS command.

  1. … 16 more files in changeset.
TRAFODION-2498 Add support to run hive stmts from traf interface

Syntax:

process hive statement '<string>';

<string>: hive statement starting with create/drop/alter/truncate.

These are the only stmts currently supported.

Ex:

>>process hive statement 'create database trafsch';

will create hive database 'trafsch'

>>process hive statement 'create table trafsch.t (a int)';

will create hive table 't' in hive schema 'trafsch'.

'process hive statment ..' could be issued from any traf interface

(sqlci/trafci/jdbc...)

  1. … 24 more files in changeset.
TRAFODION-2492 Support for native hive views, plus few more changes

-- added support for native hive views created externally. These views

can be accessed in a traf sql query.

There are some restrictions as listed below:

-- privileges support has not yet been added. That will be done, as

needed, in the next checkin.

-- usage info for tables contained in a native hive view is not maintained.

-- native hive views cannot be inserted/updated/deleted

-- cannot update stats on a native hive view

-- support for GET statements to retrieve hive data

get tables/views/objects in schema hive.sch;

-- this will return all tables/views in specified schema(hive database)

get tables/views/objects in catalog hive;

-- this will return all tables/views in hive

get schemas in catalog hive;

-- this will return all schemas(databases) that exist in hive

-- GET statements to retrieve hive data now supports optional MATCH clause.

This can be used to filter results.

-- showddl will show if an external table on hive was created implicitly

for internal usage (upd stats, privileges, views) or explicitly by user.

Internal creation of external table now use 'create implicit external table'

syntax and that info is stored in metadata.

-- drop external table will drop that table even if underlying hive table

is missing. Currently it returns an error.

-- at runtime, accessing a missing hive table now returns a better error

message instead of an internal "data mod check failed" message.

-- regress/tools/runallsb has 2 new options:

-basetests (this will run core,compGeneral,executor,seabase,hive)

-othertests (this will run all other tests suites)

-- optimizer/NATable.cpp was incorrectly indented by some checkin from

a few days back. TABs were used instead of spaces which caused code

to become all crooked. That has been fixed.

-- regress/hive/TEST007 has been updated with additional hive view tests

  1. … 26 more files in changeset.
TRAFODION-2175 a user should only see specific schemas/tables that he has privs TRAFODION-1573 Additional GET commands for privileges

This is one of several deliveries to improve GET commands:

- return details about objects that are only visible to the current_user.

- support additional statements

This delivery adds visibility checking to to the following commands:

get users;

get roles;

get users for role <role>;

get roles for user <user>;

It now supports the following GET statements:

get privileges for user <user>;

get privileges for role <role>;

When getting privileges for a user or role, the output is as follows:

<privileges> <object> <optional column name>

<privileges> output is a character string containing granted privileges:

char 1: SELECT_PRIV - "S"

char 2: INSERT_PRIV - "I"

char 3: DELETE_PRIV - "D"

char 4: UPDATE_PRIV - "U"

char 5: USAGE_PRIV - "G"

char 6: REFERENCES_PRIV - "R"

char 7: EXECUTE_PRIV - "E"

If the user/role has no privilege then "-" is specified for the character

Example: get privileges for user userx;

SI--G-E TRAFODION.MYSCH.MYTABLE1

S------ TRAFODION.MYSCH.MYTABLE2 <Column> column1

S--U--- TRAFODION.MYSCH.MYTABLE2 <Column> column2

When getting privileges for a role, only those privileges granted to the role

are returned.

When getting privileges for a user, privileges directly granted to the user

plus privileges granted to any roles associated with the user are returned.

A new regression test - privs1/TEST123 has been added to test these changes.

In addition, unused methods were removed from Get code.

  1. … 4 more files in changeset.
[TRAFODION-2351] Bulk load with log error rows enhancements

LOAD with log error rows failed when ERRORCOUNTER hbase table already exists.

LOAD command now returns the number of error rows skipped.

LOAD with truncate option dumps core when encounters an error.

Similar issue exist with PURGEDATA command too.

  1. … 18 more files in changeset.
Merge remote branch 'origin/master' into empty_lob_work

  1. … 22 more files in changeset.
Changes to support new syntax and implementation empty_blob/empty_clob for insert/updates Changes to support new syntax for updating a lob directly through a lobhandle without scanning the table.This is done via new ExeUtil operator. Changes to add columnname info to LOBMD_ table. This helps in mapping any given lobhandle back to the table and the column. Added new sections to the regression test executor/TEST130 to test these changes

  1. … 40 more files in changeset.
Merge [TRAFODION-2351] PR 876 Bulk load with log error rows enhancements

  1. … 4 more files in changeset.
TRAFODION-1586 Add support for external Traf tables mappedd to HBase tables

This is the initial support for HBase mapped tables.

A doc for external manuals will be added later.

regress/seabase/TEST022 contains various testcases.

  1. … 77 more files in changeset.
[TRAFODION-2351] Bulk load with log error rows enhancements

The LOAD command now outputs as follows:

Load with log error rows into selva.customer select * from hive.hive.customer ;

Task: LOAD Status: Started Object: TRAFODION.SELVA.CUSTOMER

Task: CLEANUP Status: Started Time: 2016-12-11 00:54:37.642

Task: CLEANUP Status: Ended Time: 2016-12-11 00:54:37.672

Task: CLEANUP Status: Ended Elapsed Time: 00:00:00.030

Logging Location: /bulkload/logs/ERR_TRAFODION.SELVA.CUSTOMER_20161211_005437

Task: LOADING DATA Status: Started Time: 2016-12-11 00:54:37.672

Rows Processed: 99997

Task: LOADING DATA Status: Ended Time: 2016-12-11 00:54:58.296

Task: LOADING DATA Status: Ended Elapsed Time: 00:00:20.624

Task: COMPLETION Status: Started Time: 2016-12-11 00:54:58.296

Task: COMPLETION Status: Ended Time: 2016-12-11 00:54:59.521

Task: COMPLETION Status: Ended Elapsed Time: 00:00:00.756

In addition, currently the "LOADING DATA" task status is shown as it happens. In future,

the task status will be shown as it happens for all tasks.

  1. … 13 more files in changeset.
Merge [TRAFODION-2365] PR 850 HBase snapshot concept needs to be contained within HBaseClinet in Trafodion

[Trafodion 2351] HBase snapshot concept needs to be contained within HBaseClient in Trafodion

Moved snapshot creation/deletion from SequenceFileWriter to HBaseClient.

  1. … 14 more files in changeset.
[TRAFODION-2356] HBase snapshot concept needs to be contained within HBaseClient in Trafodion

Moved snapshot creation/deletion from SequenceFileWriter to HBaseClient.

  1. … 13 more files in changeset.
TRAFODION-2363 Add support to return hive MD info in relational format

  1. … 21 more files in changeset.