IMPALA-995: Add plan hints embedded in comments and preserve them in views.

This patch adds two new hint styles:
1. Traditional commented hint: /* +hint1,hint2,hint3 */
2. End-of-line commented hint: -- +hint1,hint2,hint3\n

We now preserve hints when creating views. We always use the
end-of-line commented hint style to allow Hive to read
hinted views created by Impala. Hive does not support
traditional /* */ comments, and attempts to parse /*+ */ as
hints, failing with a parse error on unrecognized hints.

This patch also changes Impala to only issue a warning
for unrecognized hints instead of throwing an error. This
allows Impala to run against hinted views created by Hive.

Change-Id: I6e8352442e763c0029f72c17363caa087572dca0
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/4235
Reviewed-by: Alex Behm <alex.behm@cloudera.com>
Tested-by: jenkins
IMPALA-1151: Fix use-after-free in webserver

It's an error to add a temporary string directly to a RapidJson document
without wrapping it in a Value object first, because the latter will
copy the data whereas the former only moves it. Unfortunately, RapidJson
doesn't do anything to prevent this usage (which is, at least, safe for
literals).

Webserver::RootHandler() had several of these errors. I don't think we
ever saw a related crash, but if someone had hammered
http://<impalad>:25000/ there may have been an issue.

Change-Id: Ic3d5f6bdd7e60f4660f4eb713385664e76fb565f
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/4360
Reviewed-by: Daniel Hecht <dhecht@cloudera.com>
Tested-by: jenkins
IMPALA-1257: Fix asan issue with string literals.

Change-Id: I31a24a3323081b6486bf7baf450f8fb2fdc56ec5
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/4363
Reviewed-by: Ippokratis Pandis <ipandis@cloudera.com>
Tested-by: jenkins
IMPALA-1105 : TRUNC(TIMESTAMP) malformed input from cast

Fixed crash when TRUNC(TIMESTAMP) was passed malformed timestamp values. The fix
is for CAST(STRING to TIMESTAMP), returns NULL when STRING is malformed.

Change-Id: Ie13395d740b2587dfb59c2f677b3ed3d0d4e992f
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/3583
Reviewed-by: Victor Bittorf <victor.bittorf@cloudera.com>
Tested-by: jenkins