IMPALA-979: Abort statestore subscriber if it can't bind to its heartbeat port

Change-Id: Ifea8b8bffa8d374e8df4e1666a6b3bbfad3069c7
Reviewed-on: http://gerrit.ent.cloudera.com:8080/2474
Reviewed-by: Henry Robinson <henry@cloudera.com>
Tested-by: jenkins
External Data Source: Frontend and catalog changes

Initial frontend and catalog changes for external data sources.

Change-Id: Ia0e61ef97cfd7a4e138ef555c17f2e45bbf08c18
Reviewed-on: http://gerrit.ent.cloudera.com:8080/2224
Reviewed-by: Matthew Jacobs <mj@cloudera.com>
Tested-by: jenkins
IMPALA-724: Support infinite / nan values in text files

This patch allows the text scanner to read 'inf' or 'Infinity' from a
row and correctly translate it into floating-point infinity. It also
adds is_inf() and is_nan() builtins.

Finally, we change the text table writer to write Infinity and NaN for
compatibility with Hive.

In the future, we might consider adding nan / inf literals to our
grammar (postgres has this, see:
http://www.postgresql.org/docs/9.3/static/datatype-numeric.html).

Change-Id: I796f2852b3c6c3b72e9aae9dd5ad228d188a6ea3
Reviewed-on: http://gerrit.ent.cloudera.com:8080/2393
Reviewed-by: Henry Robinson <henry@cloudera.com>
Tested-by: jenkins
IMPALA-642: Conjunctive predicates on HBase table not working...

This commit fixes IMPALA-642 issue where conjunctive predicates are
returning incorrect results from HBase in the presence of NULL values.

The following changes are included:
1. Modified the HBaseScanNode to re-apply the "pushed-down" predicates.
2. Added tests in QueryTest/hbase-filters.test
3. Added tests in PlannerTest/hbase.test

Change-Id: I598b325ad63b043b325fba74448698ed71a3cd78
Reviewed-on: http://gerrit.ent.cloudera.com:8080/2414
Reviewed-by: Marcel Kornacker <marcel@cloudera.com>
Tested-by: jenkins
Add additional types to TColumnValue and fix field names

Adds 8 and 16 byte integer values and a binary value to TColumnValue
and fixes the field names.

Change-Id: Ie318fe7dad43b0cc0032b65b6b04c3fe173ae9b8
Reviewed-on: http://gerrit.ent.cloudera.com:8080/2418
Reviewed-by: Matthew Jacobs <mj@cloudera.com>
Tested-by: jenkins
[CDH4] IMPALA-982: Set maven-compiler-plugin to specify Java version

Change-Id: I1b41a6b4673b3a52d42a37cd0a2379b8ba64eb16
Reviewed-on: http://gerrit.ent.cloudera.com:8080/2477
Reviewed-by: Alex Behm <alex.behm@cloudera.com>
Tested-by: jenkins
Add text of Apache license

Change-Id: Ie5c6e26e2acae543cf8b17f17e18b09b7a07adf4
Reviewed-on: http://gerrit.ent.cloudera.com:8080/2484
Reviewed-by: Nong Li <nong@cloudera.com>
Tested-by: Henry Robinson <henry@cloudera.com>
Disable decimal functional tests on ASAN builds.

Change-Id: Ib652c8834361e530b337a1246d1781007a27096e
Reviewed-on: http://gerrit.ent.cloudera.com:8080/2471
Reviewed-by: Ishaan Joshi <ishaan@cloudera.com>
Tested-by: jenkins
Adding aliases ADD_MONTHS and SUB_MONTHS

This is a request for consistency with oracle.

Change-Id: I463a66694a068cd773532d8f6f853a4b089b918a
Reviewed-on: http://gerrit.ent.cloudera.com:8080/2400
Reviewed-by: Victor Bittorf <victor.bittorf@cloudera.com>
Tested-by: jenkins
IMPALA-963: Impala crash in ClearResultCache()

The issue is that Impala crashes in ClearResultCache() with result caching on
for parallel inserts. The reason is that the ClearResltCache() accesses the
coordinator RuntimeState to update the query mem tracker. However, for there is
no coordinator fragment (or RuntimeState) for parallel inserts.
The fix is to intiialize a query mem tracker to track memory usage in the coordinator
instance even if there is no coordinator fragment.

Change-Id: I3a2ef14860f683910c29ae19b931202ca6867b9f
Reviewed-on: http://gerrit.ent.cloudera.com:8080/2454
Reviewed-by: Srinath Shankar <sshankar@cloudera.com>
Tested-by: jenkins
Fix over when casting from double to decimal.

Change-Id: I6b1f87c9e4334d6f04c515adc5d2fe2c3010a49f
Reviewed-on: http://gerrit.ent.cloudera.com:8080/2494
Reviewed-by: Nong Li <nong@cloudera.com>
Tested-by: jenkins
External Data Source: Backend changes

Change-Id: Ifa62b4ea231da47facb31c3f8d43e5e3ac73591f
Reviewed-on: http://gerrit.ent.cloudera.com:8080/2284
Reviewed-by: Nong Li <nong@cloudera.com>
Tested-by: jenkins
test_data_source_tables should only run for 'text/none'

Change-Id: I784fb4305f8cff92c2582b0a7008f836c7aa9fa4
Reviewed-on: http://gerrit.ent.cloudera.com:8080/2504
Reviewed-by: Matthew Jacobs <mj@cloudera.com>
Tested-by: jenkins
IMPALA-990: Impala services should abort if there is an error starting a ThriftServer

Change-Id: I10025b0ff35c61fb6bbd0d1f8bbe1e132e70a71e
Reviewed-on: http://gerrit.ent.cloudera.com:8080/2505
Reviewed-by: Henry Robinson <henry@cloudera.com>
Tested-by: jenkins
IMPALA-989: Fix overflow with decimal divide.

Change-Id: Ia56956e562a1ecc64fc04e4b07df12f3e0ff55e5
Reviewed-on: http://gerrit.ent.cloudera.com:8080/2503
Reviewed-by: Nong Li <nong@cloudera.com>
Tested-by: jenkins
Speed up HLL computation.

Trivial change to turn a mod into an and.

Results on ndv(l_orderkey) on a bigger version of the lineitem table.
Before:
QueryTime: 1.70s

After:
QueryTime: 1.40s

Change-Id: I3fa0dcb4da6efcd8ff1115ad6e5a3bdd990a35df
Reviewed-on: http://gerrit.ent.cloudera.com:8080/2512
Reviewed-by: Nong Li <nong@cloudera.com>
Tested-by: jenkins
IMPALA-964: Full outer join on values() followed by group by hits a
preconditions check

This commit fixes IMPALA-964 where full outer join between two inline
views followed by a group by (e.g. select 1 FROM (VALUES(1 x, 1 y)) a
FULL OUTER JOIN (VALUES(1 x, 1 y)) b ON (a.x = b.y) GROUP BY a.x;)
hits a preconditions check. This check evaluates if the numNodes
(number of nodes for the purpose of resource estimation) variable
is greater or equal to zero and is triggered when we try to compute
the resource estimates (number of distinct values) of a plan fragment.

The following changes are included in this commit:
1. Modified the getNumDistinctValues function in PlanFragment class to
consider the special case where the numNodes of a plan fragment is -1.
2. Added a test case in QueryTest/joins.test.

Change-Id: I2962ed5079e174d0e76ad990ab84e1fb1a4607ef
Reviewed-on: http://gerrit.ent.cloudera.com:8080/2466
Reviewed-by: Marcel Kornacker <marcel@cloudera.com>
Tested-by: jenkins
Fix FE bug from missing casts for functions with wildcard decimal args.

Before, if none of the child args where decimals, the casts would be added.
This is because getResolvedWildcardDecimalType could return a non-null, non-decimal
type.

Change-Id: I652c3afc00ce4c2047660dc4d226b299a11069a6
Reviewed-on: http://gerrit.ent.cloudera.com:8080/2507
Reviewed-by: Marcel Kornacker <marcel@cloudera.com>
Tested-by: jenkins
Remove dependency on Hive for Impala Avro schema parsing

This change removes Impala's dependency on Hive for parsing the Avro schema. To remove the
dependency I use the Avro library to parse the schema and then reused some of Hive's AvroSerDe
code to perform the Avro -> Hive type mapping.

It also adds support for parsing DECIMAL type information from an Avro schema.

Change-Id: I4359210ce50ddc3c0d03fe9eb30d35cc8e45a797
Reviewed-on: http://gerrit.ent.cloudera.com:8080/2460
Reviewed-by: Lenni Kuff <lskuff@cloudera.com>
Tested-by: jenkins
External Data Source: Set scan handle parameter in close()

Change-Id: Ibd2d61ba52a4532b0f7b79224f70abbff1b363e4
Reviewed-on: http://gerrit.ent.cloudera.com:8080/2519
Reviewed-by: Nong Li <nong@cloudera.com>
Tested-by: jenkins