Commit Graph

11 Commits

Author SHA1 Message Date
Alex Behm
f4bbd415e8 IMPALA-4091: Fix backend unit to log in logs/be_tests.
1. Many backend unit tests did not follow proper initialization
using InitCommonRuntime(), and as a result did not write their
logs into the logs/be_tests directory.

2. Added an IMPALA_TEST_MAIN() macro that stamps out the common
main() function used in most gtest unit tests.

3. Tests added via ADD_UDF_TEST in a CMakeLists.txt did not
have the logging dir set up properly.

Testing: I validated that every test produces a corresponding
.INFO file in logs/be_tests. The only exception is promise-test
for which I added a TODO since the fix seems non-trivial.

Change-Id: Iaff0acf09bf192d54baeb0bb347e895fce6ed23b
Reviewed-on: http://gerrit.cloudera.org:8080/4352
Reviewed-by: Alex Behm <alex.behm@cloudera.com>
Tested-by: Internal Jenkins
2016-09-14 04:13:28 +00:00
Attila Jeges
211f60d831 IMPALA-1731,IMPALA-3868: Float values are not parsed correctly
Fixed StringToFloatInternal() not to parse strings like "1.23inf"
and "infinite" with leading/trailing garbage as Infinity. These
strings are now rejected with PARSE_FAILURE.
Only "inf" and "infinity" are accepted, parsing is case-insensitive.

"NaN" values are handled similarly: strings with leading/trailing
garbage like "nana" are rejected, parsing is case-insensitive.

Other changes:
- StringToFloatInternal() was cleaned up a bit. Parsing inf and NaN
strings was moved out of the main loop.
- Use std::numeric_limits<T>::infinity() instead of INFINITY macro
and std::numeric_limits<T>::quiet_NaN() instead of NAN macro.
- Fixed another minor bug: multiple dots are allowed when parsing
float values (e.g. "2.1..6" is interpreted as 2.16).
- New BE and E2E tests were added.

Change-Id: I9e17d0f051b300a22a520ce34e276c2d4460d35e
Reviewed-on: http://gerrit.cloudera.org:8080/3791
Reviewed-by: Michael Ho <kwho@cloudera.com>
Tested-by: Internal Jenkins
2016-08-24 03:34:01 +00:00
Dan Hecht
ffa7829b70 IMPALA-3918: Remove Cloudera copyrights and add ASF license header
For files that have a Cloudera copyright (and no other copyright
notice), make changes to follow the ASF source file header policy here:

http://www.apache.org/legal/src-headers.html#headers

Specifically:
1) Remove the Cloudera copyright.
2) Modify NOTICE.txt according to
   http://www.apache.org/legal/src-headers.html#notice
   to follow that format and add a line for Cloudera.
3) Replace or add the existing ASF license text with the one given
   on the website.

Much of this change was automatically generated via:

git grep -li 'Copyright.*Cloudera' > modified_files.txt
cat modified_files.txt | xargs perl -n -i -e 'print unless m#Copyright.*Cloudera#i;'
cat modified_files_txt | xargs fix_apache_license.py [1]

Some manual fixups were performed following those steps, especially when
license text was completely missing from the file.

[1] https://gist.github.com/anonymous/ff71292094362fc5c594 with minor
    modification to ORIG_LICENSE to match Impala's license text.

Change-Id: I2e0bd8420945b953e1b806041bea4d72a3943d86
Reviewed-on: http://gerrit.cloudera.org:8080/3779
Reviewed-by: Dan Hecht <dhecht@cloudera.com>
Tested-by: Internal Jenkins
2016-08-09 08:19:41 +00:00
Martin Grund
b2686ce31c IMPALA-2761: OS X: size_t, long literal fixes
On OS X size_t is a typedef to long long instead of being a #define to
long, this leads to a series of compile errors that are addressed in
this patch. In addition, on Linux the 1L literal is a long iteral and
int64_t is a long compatible type. However, on OS X, int64_t is a long
long type and thus not compatible. These issues are fixed in this patch.

The same is true for passing size_t values to the rapidjson API which
only supports uint64_t values as a similar type and thus the paramters
need to be casted.

Change-Id: Id25ad04deb5e88289741f08a8bf85fbf9fb438d6
Reviewed-on: http://gerrit.cloudera.org:8080/1607
Reviewed-by: Martin Grund <mgrund@cloudera.com>
Readability: Martin Grund <mgrund@cloudera.com>
Tested-by: Internal Jenkins
2015-12-14 22:28:58 +00:00
Martin Grund
2eb12e9593 Deprecating namespace directive declarations (std, boost)
This patch removes all occurrences of "using namespace std" and "using
namespace boost(.*)" from the codebase. However, there are still cases
where namespace directives are used (e.g. for rapidjson, thrift,
gutil). These have to be tackled in subsequent patches.

To reduce the patch size, this patch introduces a new header file called
"names.h" that will include many of our most frequently used symbols iff
the corresponding include was already added. This means, that this
header file will pull in for example map / string / vector etc, only iff
vector was already included. This requires "common/names.h" to be the
last include. After including `names.h` a new block contains a sorted list
of using definitions (this patch does not fix namespace directive
declarations for other than std / boost namespaces.)

Change-Id: Iebe4c054670d655bc355347e381dae90999cfddf
Reviewed-on: http://gerrit.cloudera.org:8080/338
Reviewed-by: Martin Grund <mgrund@cloudera.com>
Tested-by: Internal Jenkins
2015-04-18 01:26:47 +00:00
Skye Wanderman-Milne
f59c062471 IMPALA-1622: fix overflow in StringParser::StringToFloatInternal()
This bug was caused by overflowing the 'remainder' int when parsing a
floating point number with many digits after the decimal. To fix this,
this patch changes the function to stop computing remainder after
seeing 18 significant figures (i.e., digits not including leading 0s),
which prevents it from overflowing. This is safe to do according to
the IEEE binary64 (i.e. double) spec.

Change-Id: I98ec68bcae96a6b647bc274e28d3f6c2f6067769
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/5879
Reviewed-by: Daniel Hecht <dhecht@cloudera.com>
Tested-by: jenkins
2015-02-02 20:21:07 -08:00
Henry Robinson
38befd2126 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
(cherry picked from commit 58091355142cadd2b74874d9aa7c8ab6bf3efe2f)
Reviewed-on: http://gerrit.ent.cloudera.com:8080/2483
2014-05-08 12:28:53 -07:00
Skye Wanderman-Milne
057b4807ab IMPALA-769: Add empty string checks to StringParser functions
Change-Id: Id8f1ace64f90b0f2f47faa5d9fa6b8c602eafbad
Reviewed-on: http://gerrit.ent.cloudera.com:8080/1369
Reviewed-by: Skye Wanderman-Milne <skye@cloudera.com>
Tested-by: jenkins
(cherry picked from commit d3da86710646f7ae54d4a9b8759d8e31e07b8310)
Reviewed-on: http://gerrit.ent.cloudera.com:8080/1405
Tested-by: Skye Wanderman-Milne <skye@cloudera.com>
2014-01-30 10:12:29 -08:00
Alan Choi
babb2dfa72 IMPALA-527: String casts now skip leading and trailing whitespaces
Strings with leading and trailing whitespaces are accepted.
Branching is heavily optimized for the non-whitespace successful case.
All the StringTo<Type> first executes the parsing assuming it has no leading
whitespace. If failed, it will trim the leading whitespace and parse again.
Therefore, strings with whitespaces will take hit on branch mis-prediction.

Change-Id: Ie65da37a3c220e019f6dd9e3fed4baea9fb4460c
Reviewed-on: http://gerrit.ent.cloudera.com:8080/661
Reviewed-by: Alan Choi <alan@cloudera.com>
Tested-by: Alan Choi <alan@cloudera.com>
2014-01-08 10:53:38 -08:00
Alex Behm
39f9a067fa IMPALA-444: Fixed accuracy of string to double conversion. Falling back to strod for scientific notation.
Change-Id: I9a5d948620907d34601ef041e58b1c9bb2172f71
Reviewed-on: http://gerrit.ent.cloudera.com:8080/507
Tested-by: jenkins
Reviewed-by: Alex Behm <alex.behm@cloudera.com>
Tested-by: Alex Behm <alex.behm@cloudera.com>
2014-01-08 10:52:56 -08:00
Nong Li
c72a24cdd5 Updates for move to llvm 3.3. 2014-01-08 10:51:54 -08:00