[GitHub] drill pull request #1050: DRILL-5694: Do not allow queries to access paths o...

2017-11-22 Thread parthchandra
GitHub user parthchandra opened a pull request:

https://github.com/apache/drill/pull/1050

DRILL-5694: Do not allow queries to access paths outside the current …

Added check to prevent users from accessing a path outside the current 
workspace. For backward compatibility this introduces a new parameter 
'allowAccessOutsideWorkspace' in the dfs storage plugin configuration that 
allows the user to override the check and allow access outside the workspace. 
The default value for the parameter is false. Any existing storage plugin 
configurations which do not have the parameter specified will no longer be able 
to access paths outside the workspace. 

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/parthchandra/drill DRILL-5964

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/drill/pull/1050.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #1050


commit 6fa5ac7eb1520af6def3fb9f6ebd35ee7f982b01
Author: Parth Chandra 
Date:   2017-11-14T23:25:33Z

DRILL-5694: Do not allow queries to access paths outside the current 
workspace root




---


[GitHub] drill pull request #1048: DRILL-5987: Use one version of javassist

2017-11-22 Thread ilooner
Github user ilooner commented on a diff in the pull request:

https://github.com/apache/drill/pull/1048#discussion_r152703332
  
--- Diff: common/pom.xml ---
@@ -63,12 +63,29 @@
   org.msgpack
   msgpack
   0.6.6
+  
--- End diff --

Removed exclusion for msgpack. The exclusion of javassist for reflections 
is necessary because before javassist version 3.13 the groupId was 
**javassist** after version 3.13 the groupId of javassist was changed to 
**org.javassist**. I also noticed ./logical/pom.xml declared the same msgpack 
and reflections dependencies as drill common. So I removed the redundant 
dependency declaration and also made msgpack and reflections managed 
dependencies.


---


[GitHub] drill issue #1043: DRILL-5981: Add Syntax Highlighting and Error Checking to...

2017-11-22 Thread kkhatua
Github user kkhatua commented on the issue:

https://github.com/apache/drill/pull/1043
  
May be @arina-ielchiieva can help resolve squashing into one commit.
LGTM ... thanks for doing this!
+1


---


[GitHub] drill pull request #1028: DRILL-5943: Avoid the strong check introduced by D...

2017-11-22 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/drill/pull/1028


---


[GitHub] drill pull request #1036: DRILL-5962: Adding ST_AsJSON functionality

2017-11-22 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/drill/pull/1036


---


[GitHub] drill pull request #1031: DRILL-5917: Ban org.json:json library in Drill

2017-11-22 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/drill/pull/1031


---


[GitHub] drill pull request #1034: DRILL-5960: Adding asGeoJSON function

2017-11-22 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/drill/pull/1034


---


[GitHub] drill pull request #1025: DRILL-5936: Refactor MergingRecordBatch based on c...

2017-11-22 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/drill/pull/1025


---


[GitHub] drill pull request #1014: DRILL-5771: Fix serDe errors for format plugins

2017-11-22 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/drill/pull/1014


---


[GitHub] drill pull request #1030: DRILL-5941: Skip header / footer improvements for ...

2017-11-22 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/drill/pull/1030


---


[GitHub] drill pull request #1029: DRILL-5867: List profiles in pages rather than a l...

2017-11-22 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/drill/pull/1029


---


[GitHub] drill pull request #1032: DRILL-5089: Dynamically load schema of storage plu...

2017-11-22 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/drill/pull/1032


---


[GitHub] drill pull request #1044: DRILL-5980: Making queryType param for REST client...

2017-11-22 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/drill/pull/1044


---


[GitHub] drill pull request #1035: DRILL-5801: Gantt chart (fragment timeline) enhanc...

2017-11-22 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/drill/pull/1035


---


[GitHub] drill pull request #1048: DRILL-5987: Use one version of javassist

2017-11-22 Thread vrozov
Github user vrozov commented on a diff in the pull request:

https://github.com/apache/drill/pull/1048#discussion_r152690825
  
--- Diff: common/pom.xml ---
@@ -63,12 +63,29 @@
   org.msgpack
   msgpack
   0.6.6
+  
--- End diff --

Exclusions should not be necessary.


---


[GitHub] drill issue #914: DRILL-5657: Size-aware vector writer structure

2017-11-22 Thread paul-rogers
Github user paul-rogers commented on the issue:

https://github.com/apache/drill/pull/914
  
Addressed Karthik's comments, rebased on master, resolved conflicts, and 
squashed all but the conflict resolution commit.


---


[jira] [Created] (DRILL-5989) Run Smoke Tests On Travis

2017-11-22 Thread Timothy Farkas (JIRA)
Timothy Farkas created DRILL-5989:
-

 Summary: Run Smoke Tests On Travis
 Key: DRILL-5989
 URL: https://issues.apache.org/jira/browse/DRILL-5989
 Project: Apache Drill
  Issue Type: Improvement
Reporter: Timothy Farkas
Assignee: Timothy Farkas


Currently the smoke tests don't run on travis. We should update the travis.yml 
to cache maven dependencies and run the smoke tets.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[GitHub] drill issue #1048: DRILL-5987: Use one version of javassist

2017-11-22 Thread ilooner
Github user ilooner commented on the issue:

https://github.com/apache/drill/pull/1048
  
@arina-ielchiieva 


---


[GitHub] drill pull request #1048: DRILL-5987: Use one version of javassist

2017-11-22 Thread ilooner
GitHub user ilooner opened a pull request:

https://github.com/apache/drill/pull/1048

DRILL-5987: Use one version of javassist

There were two different versions of javassist being pulled in by 
**msgpack** and **reflections**. This makes sure only one version is included.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/ilooner/drill DRILL-5987

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/drill/pull/1048.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #1048


commit 23e82f4c73afbad66cab110dd06c672adcea6984
Author: Timothy Farkas 
Date:   2017-11-22T20:31:18Z

DRILL-5987: Use one version of javassist




---


[jira] [Created] (DRILL-5988) Revise operator status for OperatorFixture

2017-11-22 Thread Paul Rogers (JIRA)
Paul Rogers created DRILL-5988:
--

 Summary: Revise operator status for OperatorFixture
 Key: DRILL-5988
 URL: https://issues.apache.org/jira/browse/DRILL-5988
 Project: Apache Drill
  Issue Type: Improvement
Affects Versions: 1.13.0
Reporter: Paul Rogers
Assignee: Paul Rogers
Priority: Minor
 Fix For: 1.13.0


DRILL-5842 refactored operator contexts to simplify unit testing. This ticket 
continues that work by modifying the standard {{OperatorStats}} so it can be 
used in the {{OperatorFixture}} used for "sub-operator" unit tests.

This ticket also includes many small code cleanups so that the next "batch size 
control" PR can focus just on the core functionality.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[GitHub] drill pull request #914: DRILL-5657: Size-aware vector writer structure

2017-11-22 Thread paul-rogers
Github user paul-rogers commented on a diff in the pull request:

https://github.com/apache/drill/pull/914#discussion_r152664121
  
--- Diff: exec/memory/base/src/main/java/io/netty/buffer/DrillBuf.java ---
@@ -882,4 +882,71 @@ public void print(StringBuilder sb, int indent, 
Verbosity verbosity) {
 }
   }
 
+  // The "unsafe" methods are for use ONLY by code that does its own
+  // bounds checking. They are called "unsafe" for a reason: they will 
crash
+  // the JVM if values are addressed out of bounds.
+
+  /**
+   * Write an integer to the buffer at the given byte index, without
+   * bounds checks.
+   *
+   * @param index byte (not int) index of the location to write
+   * @param value the value to write
+   */
+
+  public void unsafePutInt(int index, int value) {
--- End diff --

Fixed.


---


[jira] [Created] (DRILL-5987) Two versions of javassist on the classpath

2017-11-22 Thread Timothy Farkas (JIRA)
Timothy Farkas created DRILL-5987:
-

 Summary: Two versions of javassist on the classpath
 Key: DRILL-5987
 URL: https://issues.apache.org/jira/browse/DRILL-5987
 Project: Apache Drill
  Issue Type: Bug
Reporter: Timothy Farkas
Assignee: Timothy Farkas


Selected output from maven dependency tree

{code}
[INFO] 
[INFO] Building Logical Plan, Base expressions 1.12.0-SNAPSHOT
[INFO] 
[INFO] 
[INFO] --- maven-dependency-plugin:2.10:tree (default-cli) @ drill-logical ---
[INFO] org.apache.drill:drill-logical:jar:1.12.0-SNAPSHOT
[INFO] +- org.apache.drill:drill-protocol:jar:1.12.0-SNAPSHOT:compile
[INFO] |  +- com.google.protobuf:protobuf-java:jar:2.5.0:compile
[INFO] |  +- com.dyuproject.protostuff:protostuff-core:jar:1.0.8:compile
[INFO] |  |  \- com.dyuproject.protostuff:protostuff-api:jar:1.0.8:compile
[INFO] |  \- com.dyuproject.protostuff:protostuff-json:jar:1.0.8:compile
[INFO] | \- org.codehaus.jackson:jackson-core-asl:jar:1.9.13:compile
[INFO] +- org.apache.drill:drill-common:jar:1.12.0-SNAPSHOT:compile
[INFO] +- org.apache.drill:drill-common:jar:tests:1.12.0-SNAPSHOT:test
[INFO] +- junit:junit:jar:4.11:compile
[INFO] |  \- org.hamcrest:hamcrest-core:jar:1.3:compile
[INFO] +- org.apache.calcite:calcite-core:jar:1.4.0-drill-r23:compile
[INFO] |  +- org.apache.calcite:calcite-avatica:jar:1.4.0-drill-r23:compile
[INFO] |  +- org.apache.calcite:calcite-linq4j:jar:1.4.0-drill-r23:compile
[INFO] |  +- commons-dbcp:commons-dbcp:jar:1.4:compile
[INFO] |  |  \- commons-pool:commons-pool:jar:1.5.4:compile
[INFO] |  +- com.google.code.findbugs:jsr305:jar:1.3.9:compile
[INFO] |  +- net.hydromatic:eigenbase-properties:jar:1.1.5:compile
[INFO] |  +- org.codehaus.janino:janino:jar:2.7.6:compile
[INFO] |  +- org.codehaus.janino:commons-compiler:jar:2.7.6:compile
[INFO] |  \- org.pentaho:pentaho-aggdesigner-algorithm:jar:5.1.5-jhyde:compile
[INFO] | \- commons-lang:commons-lang:jar:2.4:compile
[INFO] +- com.typesafe:config:jar:1.0.0:compile
[INFO] +- org.apache.commons:commons-lang3:jar:3.1:compile
[INFO] +- org.msgpack:msgpack:jar:0.6.6:compile
[INFO] |  +- com.googlecode.json-simple:json-simple:jar:1.1.1:compile
[INFO] |  \- org.javassist:javassist:jar:3.16.1-GA:compile
[INFO] +- org.reflections:reflections:jar:0.9.8:compile
[INFO] |  +- javassist:javassist:jar:3.12.1.GA:compile
[INFO] |  \- dom4j:dom4j:jar:1.6.1:compile
[INFO] | \- xml-apis:xml-apis:jar:1.0.b2:compile
{code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[GitHub] drill issue #1043: DRILL-5981: Add Syntax Highlighting and Error Checking to...

2017-11-22 Thread cgivre
Github user cgivre commented on the issue:

https://github.com/apache/drill/pull/1043
  
I made the requested fixes, and attempted to squash the commits into one, 
but failed on that last step. I actually renamed the js director 
`ace-code-editor`, which seemed descriptive to me. 


---


[GitHub] drill issue #1030: DRILL-5941: Skip header / footer improvements for Hive st...

2017-11-22 Thread parthchandra
Github user parthchandra commented on the issue:

https://github.com/apache/drill/pull/1030
  
+1


---


[GitHub] drill issue #1043: DRILL-5981: Add Syntax Highlighting and Error Checking to...

2017-11-22 Thread kkhatua
Github user kkhatua commented on the issue:

https://github.com/apache/drill/pull/1043
  
@cgivre 
Just edited the last comment to remove the +1 [ Learnt that I should wait 
till there is a response to my asks first! :) ] . 
To summarize, here are my 3 asks:
1. Change the theme to **Crimson** or **Eclipse** since that's a more 
familiar theme and actually helps the colors stand out.
2. Change the `src-min-noconflict` directory to reflect the name of the 
library, whose files it contains. e.g. `aceJs`
3. Remove any non-mandatory files, e.g. `snippets` directory doesn't seems 
to be a requirement for the library. This would help in maintaining future 
updates to the library or debugging. 


---


[GitHub] drill pull request #1047: DRILL-5970: DrillParquetReader always builds the s...

2017-11-22 Thread vdiravka
GitHub user vdiravka opened a pull request:

https://github.com/apache/drill/pull/1047

DRILL-5970: DrillParquetReader always builds the schema with "OPTIONA…

…L" dataMode columns instead of "REQUIRED" ones

- Added supporting of specifying the DataMode of data type in MapWriter;
- Use nullable vectors in case of parent nested data type with OPTIONAL 
repetition.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/vdiravka/drill DRILL-5970

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/drill/pull/1047.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #1047


commit 22fe81068aebd4599433f12eb48ab6aa1e4d7433
Author: Vitalii Diravka 
Date:   2017-11-10T14:31:05Z

DRILL-5970: DrillParquetReader always builds the schema with "OPTIONAL" 
dataMode columns instead of "REQUIRED" ones

- Added supporting of specifying the DataMode of data type in MapWriter;
- Use nullable vectors in case of parent nested data type with OPTIONAL 
repetition.




---


[GitHub] drill pull request #1046: DRILL-5986: Update jackson-databind version to 2.7...

2017-11-22 Thread vvysotskyi
GitHub user vvysotskyi opened a pull request:

https://github.com/apache/drill/pull/1046

DRILL-5986: Update jackson-databind version to 2.7.9.1



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/vvysotskyi/drill DRILL-5986

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/drill/pull/1046.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #1046


commit b5dd2af5272cfd08237122cf21fc2fee5ec8a6df
Author: Volodymyr Vysotskyi 
Date:   2017-11-22T15:45:42Z

DRILL-5986: Update jackson-databind version to 2.7.9.1




---


[jira] [Created] (DRILL-5986) Update jackson-databind version to 2.7.9.1

2017-11-22 Thread Volodymyr Vysotskyi (JIRA)
Volodymyr Vysotskyi created DRILL-5986:
--

 Summary: Update jackson-databind version to 2.7.9.1
 Key: DRILL-5986
 URL: https://issues.apache.org/jira/browse/DRILL-5986
 Project: Apache Drill
  Issue Type: Bug
Reporter: Volodymyr Vysotskyi
Assignee: Volodymyr Vysotskyi


Currently, Drill uses module {{jackson-databind}} v. 2.7.8. The goal of this 
Jira is to update {{Jackson}} version to 2.7.9 and {{jackson-databind}} to 
2.7.9.1 since few critical bugs were fixed in this version.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[GitHub] drill issue #1031: DRILL-5917: Ban org.json:json library in Drill

2017-11-22 Thread vrozov
Github user vrozov commented on the issue:

https://github.com/apache/drill/pull/1031
  
rebased to upstream/master and squashed commits.


---


[GitHub] drill pull request #1033: DRILL-5952: Implement "CREATE TABLE IF NOT EXISTS"

2017-11-22 Thread arina-ielchiieva
Github user arina-ielchiieva commented on a diff in the pull request:

https://github.com/apache/drill/pull/1033#discussion_r152582047
  
--- Diff: 
exec/java-exec/src/test/java/org/apache/drill/exec/sql/TestViewSupport.java ---
@@ -311,6 +311,75 @@ public void createViewWhenViewAlreadyExists() throws 
Exception {
 }
   }
 
+  @Test // DRILL-5952
+  public void createViewIfNotExistsWhenTableAlreadyExists() throws 
Exception {
+final String tableName = generateViewName();
+
+try {
+  final String tableDef = "SELECT region_id, sales_city FROM 
cp.`region.json` ORDER BY `region_id` LIMIT 2";
+
+  test("CREATE TABLE %s.%s as %s", DFS_TMP_SCHEMA, tableName, 
tableDef);
--- End diff --

There is not need to create table before creating the view just use select 
statement.


---


[GitHub] drill pull request #1033: DRILL-5952: Implement "CREATE TABLE IF NOT EXISTS"

2017-11-22 Thread arina-ielchiieva
Github user arina-ielchiieva commented on a diff in the pull request:

https://github.com/apache/drill/pull/1033#discussion_r152561351
  
--- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/SqlConverter.java
 ---
@@ -382,6 +382,9 @@ public int getInSubqueryThreshold() {
* @return The sql with a ^ character under the error
*/
   static String formatSQLParsingError(String sql, SqlParserPos pos) {
+if (pos == null) {
--- End diff --

Please give an example, when such case is possible?


---


[GitHub] drill pull request #1033: DRILL-5952: Implement "CREATE TABLE IF NOT EXISTS"

2017-11-22 Thread arina-ielchiieva
Github user arina-ielchiieva commented on a diff in the pull request:

https://github.com/apache/drill/pull/1033#discussion_r152583668
  
--- Diff: 
exec/java-exec/src/test/java/org/apache/drill/exec/sql/TestViewSupport.java ---
@@ -311,6 +311,75 @@ public void createViewWhenViewAlreadyExists() throws 
Exception {
 }
   }
 
+  @Test // DRILL-5952
+  public void createViewIfNotExistsWhenTableAlreadyExists() throws 
Exception {
+final String tableName = generateViewName();
+
+try {
+  final String tableDef = "SELECT region_id, sales_city FROM 
cp.`region.json` ORDER BY `region_id` LIMIT 2";
+
+  test("CREATE TABLE %s.%s as %s", DFS_TMP_SCHEMA, tableName, 
tableDef);
+
+  // Try to create the view with same name in same schema with if not 
exists clause.
+  final String createViewSql = String.format("CREATE VIEW IF NOT 
EXISTS %s.`%s` AS %s", DFS_TMP_SCHEMA, tableName, tableDef);
+
+  testBuilder()
+.sqlQuery(createViewSql)
+.unOrdered()
+.baselineColumns("ok", "summary")
+.baselineValues(false,
+  String.format("A non-view table with given name [%s] already 
exists in schema [%s]", tableName, DFS_TMP_SCHEMA))
+.go();
+
+} finally {
+  FileUtils.deleteQuietly(new File(dirTestWatcher.getDfsTestTmpDir(), 
tableName));
+}
+  }
+
+  @Test // DRILL-5952
+  public void createViewIfNotExistsWhenViewAlreadyExists() throws 
Exception {
+final String viewName = generateViewName();
+
+try {
+  final String viewDef1 = "SELECT region_id, sales_city FROM 
cp.`region.json` ORDER BY `region_id` LIMIT 2";
+
+  // Create the view
+  createViewHelper(DFS_TMP_SCHEMA, viewName, DFS_TMP_SCHEMA, null, 
viewDef1);
+
+  // Try to create the view with same name in same schema with if not 
exists clause.
+  final String viewDef2 = "SELECT sales_state_province FROM 
cp.`region.json` ORDER BY `region_id`";
+  final String createViewSql = String.format("CREATE VIEW IF NOT 
EXISTS %s.`%s` AS %s", DFS_TMP_SCHEMA, viewName, viewDef2);
+
+  testBuilder()
+.sqlQuery(createViewSql)
+.unOrdered()
+.baselineColumns("ok", "summary")
+.baselineValues(false,
+  String.format("A view with given name [%s] already exists in 
schema [%s]", viewName, DFS_TMP_SCHEMA))
+.go();
+
+  // Make sure the view created returns the data expected.
+  queryViewHelper(String.format("SELECT * FROM %s.`%s` LIMIT 1", 
DFS_TMP_SCHEMA, viewName),
+new String[]{"region_id", "sales_city"},
+ImmutableList.of(new Object[]{0L, "None"})
+  );
+} finally {
+  dropViewHelper(DFS_TMP_SCHEMA, viewName, DFS_TMP_SCHEMA);
+}
+  }
+
+  @Test // DRILL-5952
+  public void createViewWithBothOrReplaceAndIfNotExists() throws Exception 
{
+final String viewName = generateViewName();
+
+final String viewDef = "SELECT region_id, sales_city FROM 
cp.`region.json`";
+
+// Try to create the view with both  and  
clause.
+final String createViewSql = String.format("CREATE OR REPLACE VIEW IF 
NOT EXISTS %s.`%s` AS %s", DFS_TMP_SCHEMA, viewName, viewDef);
+
+errorMsgTestHelper(createViewSql, "Create view statement cannot have 
both  and  clause");
+  }
+
--- End diff --

Please add unit test to check if view is created with `if not exists` 
clause.


---


[GitHub] drill pull request #1033: DRILL-5952: Implement "CREATE TABLE IF NOT EXISTS"

2017-11-22 Thread arina-ielchiieva
Github user arina-ielchiieva commented on a diff in the pull request:

https://github.com/apache/drill/pull/1033#discussion_r152583194
  
--- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/handlers/ViewHandler.java
 ---
@@ -78,47 +78,58 @@ public PhysicalPlan getPlan(SqlNode sqlNode) throws 
ValidationException, RelConv
   final View view = new View(newViewName, viewSql, 
newViewRelNode.getRowType(),
   SchemaUtilites.getSchemaPathAsList(defaultSchema));
 
-  validateViewCreationPossibility(drillSchema, createView, context);
+  final String schemaPath = drillSchema.getFullSchemaName();
--- End diff --

It's a good practice in Java to factor out large code pieces into separate 
methods. I did this before in this class but your changes incorporated all 
logic back... Maybe there is a way to keep this logic separately here and in 
CreateTableHandler.class?


---


[GitHub] drill pull request #1033: DRILL-5952: Implement "CREATE TABLE IF NOT EXISTS"

2017-11-22 Thread arina-ielchiieva
Github user arina-ielchiieva commented on a diff in the pull request:

https://github.com/apache/drill/pull/1033#discussion_r152580600
  
--- Diff: 
exec/java-exec/src/test/java/org/apache/drill/exec/sql/TestCTAS.java ---
@@ -254,6 +255,66 @@ public void createTableWithCustomUmask() throws 
Exception {
 }
   }
 
+  @Test // DRILL-5952
+  public void 
testCreateTableIfNotExistsWhenTableWithSameNameAlreadyExists() throws Exception{
+final String newTblName = 
"createTableIfNotExistsWhenATableWithSameNameAlreadyExists";
+
+try {
+  String ctasQuery = String.format("CREATE TABLE %s.%s AS SELECT * 
from cp.`region.json`", DFS_TMP_SCHEMA, newTblName);
+
+  test(ctasQuery);
+
+  ctasQuery =
+String.format("CREATE TABLE IF NOT EXISTS %s.%s AS SELECT * FROM 
cp.`employee.json`", DFS_TMP_SCHEMA, newTblName);
+
+  testBuilder()
+.sqlQuery(ctasQuery)
+.unOrdered()
+.baselineColumns("ok", "summary")
+.baselineValues(false, String.format("A table or view with given 
name [%s] already exists in schema [%s]", newTblName, DFS_TMP_SCHEMA))
+.go();
+} finally {
+  test(String.format("DROP TABLE IF EXISTS %s.%s", DFS_TMP_SCHEMA, 
newTblName));
--- End diff --

Please remove `String.format` here and other unit tests, `test()` method 
already incorporates it.


---


[GitHub] drill pull request #1033: DRILL-5952: Implement "CREATE TABLE IF NOT EXISTS"

2017-11-22 Thread arina-ielchiieva
Github user arina-ielchiieva commented on a diff in the pull request:

https://github.com/apache/drill/pull/1033#discussion_r152579484
  
--- Diff: exec/java-exec/src/main/codegen/includes/parserImpls.ftl ---
@@ -215,11 +223,12 @@ SqlNode SqlDropView() :
 
 /**
  * Parses a CTAS or CTTAS statement.
- * CREATE [TEMPORARY] TABLE tblname [ (field1, field2, ...) ] AS 
select_statement.
+ * CREATE [TEMPORARY] TABLE [IF NOT EXISTS] tblname [ (field1, field2, 
...) ] AS select_statement.
  */
 SqlNode SqlCreateTable() :
 {
 SqlParserPos pos;
+boolean tableNonExistenceCheck = false;
--- End diff --

Not critical but I am in favor of adding new parameters in the end. Of 
course if logically it is not required.


---


[GitHub] drill pull request #1033: DRILL-5952: Implement "CREATE TABLE IF NOT EXISTS"

2017-11-22 Thread arina-ielchiieva
Github user arina-ielchiieva commented on a diff in the pull request:

https://github.com/apache/drill/pull/1033#discussion_r152580204
  
--- Diff: exec/java-exec/src/main/codegen/includes/parserImpls.ftl ---
@@ -172,26 +172,34 @@ SqlNodeList ParseRequiredFieldList(String relType) :
 
 /**
  * Parses a create view or replace existing view statement.
- *   CREATE [OR REPLACE] VIEW view_name [ (field1, field2 ...) ] AS 
select_statement
+ *   CREATE { [OR REPLACE] VIEW | VIEW [IF NOT EXISTS] | VIEW } view_name 
[ (field1, field2 ...) ] AS select_statement
  */
 SqlNode SqlCreateOrReplaceView() :
 {
 SqlParserPos pos;
-boolean replaceView = false;
 SqlIdentifier viewName;
 SqlNode query;
 SqlNodeList fieldList;
+String createViewType = "0";
--- End diff --

Maybe use enum rather that 0, 1, 2 in string equivalent.  First it would be 
much clearer, second you won't need to add comments explaining what these 
numbers mean in `ViewHandler` class. Enum definition can be stored in 
`SqlCreateView.class`, to make it work in parser - just add imports in 
`vv_imports.ftl`. 


---


[GitHub] drill issue #921: DRILL-4286 Graceful shutdown of drillbit

2017-11-22 Thread arina-ielchiieva
Github user arina-ielchiieva commented on the issue:

https://github.com/apache/drill/pull/921
  
@dvjyothsna  also please remove `e.printStackTrace();` from the code, I see 
4 occurrences.


---


[GitHub] drill issue #921: DRILL-4286 Graceful shutdown of drillbit

2017-11-22 Thread arina-ielchiieva
Github user arina-ielchiieva commented on the issue:

https://github.com/apache/drill/pull/921
  
@paul-rogers is right, there is something wrong with the protos @dvjyothsna 
has generated.
I took master branch and generated protos. No changes so these extra 
changes we see are wrong. Also I have created branch where I have added changes 
in protos from this PR [1] and from the diff it can be seen that no extra 
changes as well [2].

@dvjyothsna please address this issue.
If it helps:
I have installed protoc:
```
protoc --version
libprotoc 2.5.0
```
and generated using the following:
```
cd ~/git_repo/drill/protocol
mvn process-sources -P proto-compile
```
[1] https://github.com/arina-ielchiieva/drill/tree/DRILL-4386-proto
[2] 
https://github.com/arina-ielchiieva/drill/commit/07af545ab27b77e5f86002d4ce0f54b3dd371343


---


[GitHub] drill issue #1040: Drill 5425

2017-11-22 Thread arina-ielchiieva
Github user arina-ielchiieva commented on the issue:

https://github.com/apache/drill/pull/1040
  
@sohami could you please update pull request header to include Jira title? 
It would be just easier to identify it among others. Thanks.


---


[GitHub] drill issue #1044: DRILL-5980: Making queryType param for REST client case-i...

2017-11-22 Thread arina-ielchiieva
Github user arina-ielchiieva commented on the issue:

https://github.com/apache/drill/pull/1044
  
+1, LGTM.


---


[GitHub] drill issue #1031: DRILL-5917: Ban org.json:json library in Drill

2017-11-22 Thread arina-ielchiieva
Github user arina-ielchiieva commented on the issue:

https://github.com/apache/drill/pull/1031
  
I see some functional test failures but I don't think they are related, it 
might be that your branch is not based on the latest master, so +1, LGTM.
@vrozov thanks for making the changes!


---


[jira] [Created] (DRILL-5985) Drill return IndexOutOfBoundsException when column name in the file doesnt match the exact case

2017-11-22 Thread sunny rajpal (JIRA)
sunny rajpal created DRILL-5985:
---

 Summary: Drill return IndexOutOfBoundsException when column name 
in the file doesnt match the exact case
 Key: DRILL-5985
 URL: https://issues.apache.org/jira/browse/DRILL-5985
 Project: Apache Drill
  Issue Type: Bug
Reporter: sunny rajpal


columns in file has camel casing , when we write query with column name as full 
upper or lower it gives 

Error: SYSTEM ERROR: IndexOutOfBoundsException: index: 32384, length: 4 
(expected: range(0, 16384))

Fragment 0:0



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)