[24/47] phoenix git commit: PHOENIX-2030 CsvBulkLoadTool should use logical name of the table for output directory suffix(Rajeshbabu)
PHOENIX-2030 CsvBulkLoadTool should use logical name of the table for output directory suffix(Rajeshbabu) Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/3cf22a7d Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/3cf22a7d Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/3cf22a7d Branch: refs/heads/calcite Commit: 3cf22a7de4eaec6978763b6961d73aa9eaa07015 Parents: 50f3a04 Author: Rajeshbabu Chintaguntla rajeshb...@apache.org Authored: Thu Jun 25 01:16:51 2015 +0530 Committer: Rajeshbabu Chintaguntla rajeshb...@apache.org Committed: Thu Jun 25 01:16:51 2015 +0530 -- .../phoenix/mapreduce/CsvBulkLoadToolIT.java | 19 +++ .../phoenix/mapreduce/CsvBulkLoadTool.java | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/3cf22a7d/phoenix-core/src/it/java/org/apache/phoenix/mapreduce/CsvBulkLoadToolIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/mapreduce/CsvBulkLoadToolIT.java b/phoenix-core/src/it/java/org/apache/phoenix/mapreduce/CsvBulkLoadToolIT.java index 392395d..6bcc221 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/mapreduce/CsvBulkLoadToolIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/mapreduce/CsvBulkLoadToolIT.java @@ -39,6 +39,7 @@ import org.apache.phoenix.end2end.NeedsOwnMiniClusterTest; import org.apache.phoenix.jdbc.PhoenixDriver; import org.apache.phoenix.util.DateUtil; import org.apache.phoenix.util.PhoenixRuntime; +import org.apache.phoenix.util.QueryUtil; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; @@ -206,6 +207,8 @@ public class CsvBulkLoadToolIT { String ddl = CREATE LOCAL INDEX TABLE6_IDX ON TABLE6 + (FIRST_NAME ASC); stmt.execute(ddl); +ddl = CREATE LOCAL INDEX TABLE6_IDX2 ON TABLE6 + (LAST_NAME ASC); +stmt.execute(ddl); FileSystem fs = FileSystem.get(hbaseTestUtil.getConfiguration()); FSDataOutputStream outputStream = fs.create(new Path(/tmp/input3.csv)); @@ -228,6 +231,22 @@ public class CsvBulkLoadToolIT { assertEquals(FirstName 2, rs.getString(2)); rs.close(); +rs = +stmt.executeQuery(EXPLAIN SELECT id, FIRST_NAME FROM TABLE6 where first_name='FirstName 2'); +assertEquals( +CLIENT 1-CHUNK PARALLEL 1-WAY RANGE SCAN OVER _LOCAL_IDX_TABLE6 [-32768,'FirstName 2']\n ++ SERVER FILTER BY FIRST KEY ONLY, QueryUtil.getExplainPlan(rs)); +rs.close(); +rs = stmt.executeQuery(SELECT id, LAST_NAME FROM TABLE6 where last_name='LastName 2'); +assertTrue(rs.next()); +assertEquals(2, rs.getInt(1)); +assertEquals(LastName 2, rs.getString(2)); +rs.close(); +rs = +stmt.executeQuery(EXPLAIN SELECT id, LAST_NAME FROM TABLE6 where last_name='LastName 2'); +assertEquals( +CLIENT 1-CHUNK PARALLEL 1-WAY RANGE SCAN OVER _LOCAL_IDX_TABLE6 [-32767,'LastName 2']\n ++ SERVER FILTER BY FIRST KEY ONLY, QueryUtil.getExplainPlan(rs)); stmt.close(); } http://git-wip-us.apache.org/repos/asf/phoenix/blob/3cf22a7d/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/CsvBulkLoadTool.java -- diff --git a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/CsvBulkLoadTool.java b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/CsvBulkLoadTool.java index 9e27bac..5270277 100644 --- a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/CsvBulkLoadTool.java +++ b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/CsvBulkLoadTool.java @@ -265,7 +265,7 @@ public class CsvBulkLoadTool extends Configured implements Tool { JobManager.createThreadPoolExec(Integer.MAX_VALUE, 5, 20, useInstrumentedPool); try{ for (TargetTableRef table : tablesToBeLoaded) { - Path tablePath = new Path(outputPath, table.getPhysicalName()); + Path tablePath = new Path(outputPath, table.getLogicalName()); Configuration jobConf = new Configuration(conf); jobConf.set(CsvToKeyValueMapper.TABLE_NAME_CONFKEY, qualifiedTableName); if (qualifiedTableName.compareToIgnoreCase(table.getLogicalName()) != 0) {
[16/16] phoenix git commit: PHOENIX-2030 CsvBulkLoadTool should use logical name of the table for output directory suffix(Rajeshbabu)
PHOENIX-2030 CsvBulkLoadTool should use logical name of the table for output directory suffix(Rajeshbabu) Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/3cf22a7d Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/3cf22a7d Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/3cf22a7d Branch: refs/heads/json Commit: 3cf22a7de4eaec6978763b6961d73aa9eaa07015 Parents: 50f3a04 Author: Rajeshbabu Chintaguntla rajeshb...@apache.org Authored: Thu Jun 25 01:16:51 2015 +0530 Committer: Rajeshbabu Chintaguntla rajeshb...@apache.org Committed: Thu Jun 25 01:16:51 2015 +0530 -- .../phoenix/mapreduce/CsvBulkLoadToolIT.java | 19 +++ .../phoenix/mapreduce/CsvBulkLoadTool.java | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/3cf22a7d/phoenix-core/src/it/java/org/apache/phoenix/mapreduce/CsvBulkLoadToolIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/mapreduce/CsvBulkLoadToolIT.java b/phoenix-core/src/it/java/org/apache/phoenix/mapreduce/CsvBulkLoadToolIT.java index 392395d..6bcc221 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/mapreduce/CsvBulkLoadToolIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/mapreduce/CsvBulkLoadToolIT.java @@ -39,6 +39,7 @@ import org.apache.phoenix.end2end.NeedsOwnMiniClusterTest; import org.apache.phoenix.jdbc.PhoenixDriver; import org.apache.phoenix.util.DateUtil; import org.apache.phoenix.util.PhoenixRuntime; +import org.apache.phoenix.util.QueryUtil; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; @@ -206,6 +207,8 @@ public class CsvBulkLoadToolIT { String ddl = CREATE LOCAL INDEX TABLE6_IDX ON TABLE6 + (FIRST_NAME ASC); stmt.execute(ddl); +ddl = CREATE LOCAL INDEX TABLE6_IDX2 ON TABLE6 + (LAST_NAME ASC); +stmt.execute(ddl); FileSystem fs = FileSystem.get(hbaseTestUtil.getConfiguration()); FSDataOutputStream outputStream = fs.create(new Path(/tmp/input3.csv)); @@ -228,6 +231,22 @@ public class CsvBulkLoadToolIT { assertEquals(FirstName 2, rs.getString(2)); rs.close(); +rs = +stmt.executeQuery(EXPLAIN SELECT id, FIRST_NAME FROM TABLE6 where first_name='FirstName 2'); +assertEquals( +CLIENT 1-CHUNK PARALLEL 1-WAY RANGE SCAN OVER _LOCAL_IDX_TABLE6 [-32768,'FirstName 2']\n ++ SERVER FILTER BY FIRST KEY ONLY, QueryUtil.getExplainPlan(rs)); +rs.close(); +rs = stmt.executeQuery(SELECT id, LAST_NAME FROM TABLE6 where last_name='LastName 2'); +assertTrue(rs.next()); +assertEquals(2, rs.getInt(1)); +assertEquals(LastName 2, rs.getString(2)); +rs.close(); +rs = +stmt.executeQuery(EXPLAIN SELECT id, LAST_NAME FROM TABLE6 where last_name='LastName 2'); +assertEquals( +CLIENT 1-CHUNK PARALLEL 1-WAY RANGE SCAN OVER _LOCAL_IDX_TABLE6 [-32767,'LastName 2']\n ++ SERVER FILTER BY FIRST KEY ONLY, QueryUtil.getExplainPlan(rs)); stmt.close(); } http://git-wip-us.apache.org/repos/asf/phoenix/blob/3cf22a7d/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/CsvBulkLoadTool.java -- diff --git a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/CsvBulkLoadTool.java b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/CsvBulkLoadTool.java index 9e27bac..5270277 100644 --- a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/CsvBulkLoadTool.java +++ b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/CsvBulkLoadTool.java @@ -265,7 +265,7 @@ public class CsvBulkLoadTool extends Configured implements Tool { JobManager.createThreadPoolExec(Integer.MAX_VALUE, 5, 20, useInstrumentedPool); try{ for (TargetTableRef table : tablesToBeLoaded) { - Path tablePath = new Path(outputPath, table.getPhysicalName()); + Path tablePath = new Path(outputPath, table.getLogicalName()); Configuration jobConf = new Configuration(conf); jobConf.set(CsvToKeyValueMapper.TABLE_NAME_CONFKEY, qualifiedTableName); if (qualifiedTableName.compareToIgnoreCase(table.getLogicalName()) != 0) {
phoenix git commit: PHOENIX-2030 CsvBulkLoadTool should use logical name of the table for output directory suffix(Rajeshbabu)
Repository: phoenix Updated Branches: refs/heads/master 50f3a0412 - 3cf22a7de PHOENIX-2030 CsvBulkLoadTool should use logical name of the table for output directory suffix(Rajeshbabu) Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/3cf22a7d Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/3cf22a7d Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/3cf22a7d Branch: refs/heads/master Commit: 3cf22a7de4eaec6978763b6961d73aa9eaa07015 Parents: 50f3a04 Author: Rajeshbabu Chintaguntla rajeshb...@apache.org Authored: Thu Jun 25 01:16:51 2015 +0530 Committer: Rajeshbabu Chintaguntla rajeshb...@apache.org Committed: Thu Jun 25 01:16:51 2015 +0530 -- .../phoenix/mapreduce/CsvBulkLoadToolIT.java | 19 +++ .../phoenix/mapreduce/CsvBulkLoadTool.java | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/3cf22a7d/phoenix-core/src/it/java/org/apache/phoenix/mapreduce/CsvBulkLoadToolIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/mapreduce/CsvBulkLoadToolIT.java b/phoenix-core/src/it/java/org/apache/phoenix/mapreduce/CsvBulkLoadToolIT.java index 392395d..6bcc221 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/mapreduce/CsvBulkLoadToolIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/mapreduce/CsvBulkLoadToolIT.java @@ -39,6 +39,7 @@ import org.apache.phoenix.end2end.NeedsOwnMiniClusterTest; import org.apache.phoenix.jdbc.PhoenixDriver; import org.apache.phoenix.util.DateUtil; import org.apache.phoenix.util.PhoenixRuntime; +import org.apache.phoenix.util.QueryUtil; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; @@ -206,6 +207,8 @@ public class CsvBulkLoadToolIT { String ddl = CREATE LOCAL INDEX TABLE6_IDX ON TABLE6 + (FIRST_NAME ASC); stmt.execute(ddl); +ddl = CREATE LOCAL INDEX TABLE6_IDX2 ON TABLE6 + (LAST_NAME ASC); +stmt.execute(ddl); FileSystem fs = FileSystem.get(hbaseTestUtil.getConfiguration()); FSDataOutputStream outputStream = fs.create(new Path(/tmp/input3.csv)); @@ -228,6 +231,22 @@ public class CsvBulkLoadToolIT { assertEquals(FirstName 2, rs.getString(2)); rs.close(); +rs = +stmt.executeQuery(EXPLAIN SELECT id, FIRST_NAME FROM TABLE6 where first_name='FirstName 2'); +assertEquals( +CLIENT 1-CHUNK PARALLEL 1-WAY RANGE SCAN OVER _LOCAL_IDX_TABLE6 [-32768,'FirstName 2']\n ++ SERVER FILTER BY FIRST KEY ONLY, QueryUtil.getExplainPlan(rs)); +rs.close(); +rs = stmt.executeQuery(SELECT id, LAST_NAME FROM TABLE6 where last_name='LastName 2'); +assertTrue(rs.next()); +assertEquals(2, rs.getInt(1)); +assertEquals(LastName 2, rs.getString(2)); +rs.close(); +rs = +stmt.executeQuery(EXPLAIN SELECT id, LAST_NAME FROM TABLE6 where last_name='LastName 2'); +assertEquals( +CLIENT 1-CHUNK PARALLEL 1-WAY RANGE SCAN OVER _LOCAL_IDX_TABLE6 [-32767,'LastName 2']\n ++ SERVER FILTER BY FIRST KEY ONLY, QueryUtil.getExplainPlan(rs)); stmt.close(); } http://git-wip-us.apache.org/repos/asf/phoenix/blob/3cf22a7d/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/CsvBulkLoadTool.java -- diff --git a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/CsvBulkLoadTool.java b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/CsvBulkLoadTool.java index 9e27bac..5270277 100644 --- a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/CsvBulkLoadTool.java +++ b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/CsvBulkLoadTool.java @@ -265,7 +265,7 @@ public class CsvBulkLoadTool extends Configured implements Tool { JobManager.createThreadPoolExec(Integer.MAX_VALUE, 5, 20, useInstrumentedPool); try{ for (TargetTableRef table : tablesToBeLoaded) { - Path tablePath = new Path(outputPath, table.getPhysicalName()); + Path tablePath = new Path(outputPath, table.getLogicalName()); Configuration jobConf = new Configuration(conf); jobConf.set(CsvToKeyValueMapper.TABLE_NAME_CONFKEY, qualifiedTableName); if (qualifiedTableName.compareToIgnoreCase(table.getLogicalName()) != 0) {
phoenix git commit: PHOENIX-2030 CsvBulkLoadTool should use logical name of the table for output directory suffix(Rajeshbabu)
Repository: phoenix Updated Branches: refs/heads/4.x-HBase-1.0 37220bbab - f2b612e32 PHOENIX-2030 CsvBulkLoadTool should use logical name of the table for output directory suffix(Rajeshbabu) Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/f2b612e3 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/f2b612e3 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/f2b612e3 Branch: refs/heads/4.x-HBase-1.0 Commit: f2b612e325c1837916ca16ffa62f557e9019696a Parents: 37220bb Author: Rajeshbabu Chintaguntla rajeshb...@apache.org Authored: Thu Jun 25 01:17:26 2015 +0530 Committer: Rajeshbabu Chintaguntla rajeshb...@apache.org Committed: Thu Jun 25 01:17:26 2015 +0530 -- .../phoenix/mapreduce/CsvBulkLoadToolIT.java | 19 +++ .../phoenix/mapreduce/CsvBulkLoadTool.java | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/f2b612e3/phoenix-core/src/it/java/org/apache/phoenix/mapreduce/CsvBulkLoadToolIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/mapreduce/CsvBulkLoadToolIT.java b/phoenix-core/src/it/java/org/apache/phoenix/mapreduce/CsvBulkLoadToolIT.java index 392395d..6bcc221 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/mapreduce/CsvBulkLoadToolIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/mapreduce/CsvBulkLoadToolIT.java @@ -39,6 +39,7 @@ import org.apache.phoenix.end2end.NeedsOwnMiniClusterTest; import org.apache.phoenix.jdbc.PhoenixDriver; import org.apache.phoenix.util.DateUtil; import org.apache.phoenix.util.PhoenixRuntime; +import org.apache.phoenix.util.QueryUtil; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; @@ -206,6 +207,8 @@ public class CsvBulkLoadToolIT { String ddl = CREATE LOCAL INDEX TABLE6_IDX ON TABLE6 + (FIRST_NAME ASC); stmt.execute(ddl); +ddl = CREATE LOCAL INDEX TABLE6_IDX2 ON TABLE6 + (LAST_NAME ASC); +stmt.execute(ddl); FileSystem fs = FileSystem.get(hbaseTestUtil.getConfiguration()); FSDataOutputStream outputStream = fs.create(new Path(/tmp/input3.csv)); @@ -228,6 +231,22 @@ public class CsvBulkLoadToolIT { assertEquals(FirstName 2, rs.getString(2)); rs.close(); +rs = +stmt.executeQuery(EXPLAIN SELECT id, FIRST_NAME FROM TABLE6 where first_name='FirstName 2'); +assertEquals( +CLIENT 1-CHUNK PARALLEL 1-WAY RANGE SCAN OVER _LOCAL_IDX_TABLE6 [-32768,'FirstName 2']\n ++ SERVER FILTER BY FIRST KEY ONLY, QueryUtil.getExplainPlan(rs)); +rs.close(); +rs = stmt.executeQuery(SELECT id, LAST_NAME FROM TABLE6 where last_name='LastName 2'); +assertTrue(rs.next()); +assertEquals(2, rs.getInt(1)); +assertEquals(LastName 2, rs.getString(2)); +rs.close(); +rs = +stmt.executeQuery(EXPLAIN SELECT id, LAST_NAME FROM TABLE6 where last_name='LastName 2'); +assertEquals( +CLIENT 1-CHUNK PARALLEL 1-WAY RANGE SCAN OVER _LOCAL_IDX_TABLE6 [-32767,'LastName 2']\n ++ SERVER FILTER BY FIRST KEY ONLY, QueryUtil.getExplainPlan(rs)); stmt.close(); } http://git-wip-us.apache.org/repos/asf/phoenix/blob/f2b612e3/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/CsvBulkLoadTool.java -- diff --git a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/CsvBulkLoadTool.java b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/CsvBulkLoadTool.java index 9e27bac..5270277 100644 --- a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/CsvBulkLoadTool.java +++ b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/CsvBulkLoadTool.java @@ -265,7 +265,7 @@ public class CsvBulkLoadTool extends Configured implements Tool { JobManager.createThreadPoolExec(Integer.MAX_VALUE, 5, 20, useInstrumentedPool); try{ for (TargetTableRef table : tablesToBeLoaded) { - Path tablePath = new Path(outputPath, table.getPhysicalName()); + Path tablePath = new Path(outputPath, table.getLogicalName()); Configuration jobConf = new Configuration(conf); jobConf.set(CsvToKeyValueMapper.TABLE_NAME_CONFKEY, qualifiedTableName); if (qualifiedTableName.compareToIgnoreCase(table.getLogicalName()) != 0) {
phoenix git commit: PHOENIX-2030 CsvBulkLoadTool should use logical name of the table for output directory suffix(Rajeshbabu)
Repository: phoenix Updated Branches: refs/heads/4.4-HBase-1.0 a496896fc - cbd63ca2e PHOENIX-2030 CsvBulkLoadTool should use logical name of the table for output directory suffix(Rajeshbabu) Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/cbd63ca2 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/cbd63ca2 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/cbd63ca2 Branch: refs/heads/4.4-HBase-1.0 Commit: cbd63ca2eeb9351a53be50b3a52739f32886cf71 Parents: a496896 Author: Rajeshbabu Chintaguntla rajeshb...@apache.org Authored: Thu Jun 25 01:18:53 2015 +0530 Committer: Rajeshbabu Chintaguntla rajeshb...@apache.org Committed: Thu Jun 25 01:18:53 2015 +0530 -- .../phoenix/mapreduce/CsvBulkLoadToolIT.java | 19 +++ .../phoenix/mapreduce/CsvBulkLoadTool.java | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/cbd63ca2/phoenix-core/src/it/java/org/apache/phoenix/mapreduce/CsvBulkLoadToolIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/mapreduce/CsvBulkLoadToolIT.java b/phoenix-core/src/it/java/org/apache/phoenix/mapreduce/CsvBulkLoadToolIT.java index 392395d..6bcc221 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/mapreduce/CsvBulkLoadToolIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/mapreduce/CsvBulkLoadToolIT.java @@ -39,6 +39,7 @@ import org.apache.phoenix.end2end.NeedsOwnMiniClusterTest; import org.apache.phoenix.jdbc.PhoenixDriver; import org.apache.phoenix.util.DateUtil; import org.apache.phoenix.util.PhoenixRuntime; +import org.apache.phoenix.util.QueryUtil; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; @@ -206,6 +207,8 @@ public class CsvBulkLoadToolIT { String ddl = CREATE LOCAL INDEX TABLE6_IDX ON TABLE6 + (FIRST_NAME ASC); stmt.execute(ddl); +ddl = CREATE LOCAL INDEX TABLE6_IDX2 ON TABLE6 + (LAST_NAME ASC); +stmt.execute(ddl); FileSystem fs = FileSystem.get(hbaseTestUtil.getConfiguration()); FSDataOutputStream outputStream = fs.create(new Path(/tmp/input3.csv)); @@ -228,6 +231,22 @@ public class CsvBulkLoadToolIT { assertEquals(FirstName 2, rs.getString(2)); rs.close(); +rs = +stmt.executeQuery(EXPLAIN SELECT id, FIRST_NAME FROM TABLE6 where first_name='FirstName 2'); +assertEquals( +CLIENT 1-CHUNK PARALLEL 1-WAY RANGE SCAN OVER _LOCAL_IDX_TABLE6 [-32768,'FirstName 2']\n ++ SERVER FILTER BY FIRST KEY ONLY, QueryUtil.getExplainPlan(rs)); +rs.close(); +rs = stmt.executeQuery(SELECT id, LAST_NAME FROM TABLE6 where last_name='LastName 2'); +assertTrue(rs.next()); +assertEquals(2, rs.getInt(1)); +assertEquals(LastName 2, rs.getString(2)); +rs.close(); +rs = +stmt.executeQuery(EXPLAIN SELECT id, LAST_NAME FROM TABLE6 where last_name='LastName 2'); +assertEquals( +CLIENT 1-CHUNK PARALLEL 1-WAY RANGE SCAN OVER _LOCAL_IDX_TABLE6 [-32767,'LastName 2']\n ++ SERVER FILTER BY FIRST KEY ONLY, QueryUtil.getExplainPlan(rs)); stmt.close(); } http://git-wip-us.apache.org/repos/asf/phoenix/blob/cbd63ca2/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/CsvBulkLoadTool.java -- diff --git a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/CsvBulkLoadTool.java b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/CsvBulkLoadTool.java index 7afde98..83aefaa 100644 --- a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/CsvBulkLoadTool.java +++ b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/CsvBulkLoadTool.java @@ -265,7 +265,7 @@ public class CsvBulkLoadTool extends Configured implements Tool { JobManager.createThreadPoolExec(Integer.MAX_VALUE, 5, 20, useInstrumentedPool); try{ for (TargetTableRef table : tablesToBeLoaded) { - Path tablePath = new Path(outputPath, table.getPhysicalName()); + Path tablePath = new Path(outputPath, table.getLogicalName()); Configuration jobConf = new Configuration(conf); jobConf.set(CsvToKeyValueMapper.TABLE_NAME_CONFKEY, qualifiedTableName); if (qualifiedTableName.compareToIgnoreCase(table.getLogicalName()) != 0) {
phoenix git commit: PHOENIX-2030 CsvBulkLoadTool should use logical name of the table for output directory suffix(Rajeshbabu)
Repository: phoenix Updated Branches: refs/heads/4.x-HBase-0.98 618213be6 - 8e309c2b4 PHOENIX-2030 CsvBulkLoadTool should use logical name of the table for output directory suffix(Rajeshbabu) Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/8e309c2b Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/8e309c2b Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/8e309c2b Branch: refs/heads/4.x-HBase-0.98 Commit: 8e309c2b4cd4bb8a2689fbaed9f9c7b348cbae31 Parents: 618213b Author: Rajeshbabu Chintaguntla rajeshb...@apache.org Authored: Thu Jun 25 01:17:49 2015 +0530 Committer: Rajeshbabu Chintaguntla rajeshb...@apache.org Committed: Thu Jun 25 01:17:49 2015 +0530 -- .../phoenix/mapreduce/CsvBulkLoadToolIT.java | 19 +++ .../phoenix/mapreduce/CsvBulkLoadTool.java | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/8e309c2b/phoenix-core/src/it/java/org/apache/phoenix/mapreduce/CsvBulkLoadToolIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/mapreduce/CsvBulkLoadToolIT.java b/phoenix-core/src/it/java/org/apache/phoenix/mapreduce/CsvBulkLoadToolIT.java index 392395d..6bcc221 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/mapreduce/CsvBulkLoadToolIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/mapreduce/CsvBulkLoadToolIT.java @@ -39,6 +39,7 @@ import org.apache.phoenix.end2end.NeedsOwnMiniClusterTest; import org.apache.phoenix.jdbc.PhoenixDriver; import org.apache.phoenix.util.DateUtil; import org.apache.phoenix.util.PhoenixRuntime; +import org.apache.phoenix.util.QueryUtil; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; @@ -206,6 +207,8 @@ public class CsvBulkLoadToolIT { String ddl = CREATE LOCAL INDEX TABLE6_IDX ON TABLE6 + (FIRST_NAME ASC); stmt.execute(ddl); +ddl = CREATE LOCAL INDEX TABLE6_IDX2 ON TABLE6 + (LAST_NAME ASC); +stmt.execute(ddl); FileSystem fs = FileSystem.get(hbaseTestUtil.getConfiguration()); FSDataOutputStream outputStream = fs.create(new Path(/tmp/input3.csv)); @@ -228,6 +231,22 @@ public class CsvBulkLoadToolIT { assertEquals(FirstName 2, rs.getString(2)); rs.close(); +rs = +stmt.executeQuery(EXPLAIN SELECT id, FIRST_NAME FROM TABLE6 where first_name='FirstName 2'); +assertEquals( +CLIENT 1-CHUNK PARALLEL 1-WAY RANGE SCAN OVER _LOCAL_IDX_TABLE6 [-32768,'FirstName 2']\n ++ SERVER FILTER BY FIRST KEY ONLY, QueryUtil.getExplainPlan(rs)); +rs.close(); +rs = stmt.executeQuery(SELECT id, LAST_NAME FROM TABLE6 where last_name='LastName 2'); +assertTrue(rs.next()); +assertEquals(2, rs.getInt(1)); +assertEquals(LastName 2, rs.getString(2)); +rs.close(); +rs = +stmt.executeQuery(EXPLAIN SELECT id, LAST_NAME FROM TABLE6 where last_name='LastName 2'); +assertEquals( +CLIENT 1-CHUNK PARALLEL 1-WAY RANGE SCAN OVER _LOCAL_IDX_TABLE6 [-32767,'LastName 2']\n ++ SERVER FILTER BY FIRST KEY ONLY, QueryUtil.getExplainPlan(rs)); stmt.close(); } http://git-wip-us.apache.org/repos/asf/phoenix/blob/8e309c2b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/CsvBulkLoadTool.java -- diff --git a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/CsvBulkLoadTool.java b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/CsvBulkLoadTool.java index 9e27bac..5270277 100644 --- a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/CsvBulkLoadTool.java +++ b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/CsvBulkLoadTool.java @@ -265,7 +265,7 @@ public class CsvBulkLoadTool extends Configured implements Tool { JobManager.createThreadPoolExec(Integer.MAX_VALUE, 5, 20, useInstrumentedPool); try{ for (TargetTableRef table : tablesToBeLoaded) { - Path tablePath = new Path(outputPath, table.getPhysicalName()); + Path tablePath = new Path(outputPath, table.getLogicalName()); Configuration jobConf = new Configuration(conf); jobConf.set(CsvToKeyValueMapper.TABLE_NAME_CONFKEY, qualifiedTableName); if (qualifiedTableName.compareToIgnoreCase(table.getLogicalName()) != 0) {
phoenix git commit: PHOENIX-2030 CsvBulkLoadTool should use logical name of the table for output directory suffix(Rajeshbabu)
Repository: phoenix Updated Branches: refs/heads/4.4-HBase-1.1 f4b92cd14 - 4852cee55 PHOENIX-2030 CsvBulkLoadTool should use logical name of the table for output directory suffix(Rajeshbabu) Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/4852cee5 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/4852cee5 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/4852cee5 Branch: refs/heads/4.4-HBase-1.1 Commit: 4852cee557ee09641fcb101def8585bdf9269f20 Parents: f4b92cd Author: Rajeshbabu Chintaguntla rajeshb...@apache.org Authored: Thu Jun 25 01:18:27 2015 +0530 Committer: Rajeshbabu Chintaguntla rajeshb...@apache.org Committed: Thu Jun 25 01:18:27 2015 +0530 -- .../phoenix/mapreduce/CsvBulkLoadToolIT.java | 19 +++ .../phoenix/mapreduce/CsvBulkLoadTool.java | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/4852cee5/phoenix-core/src/it/java/org/apache/phoenix/mapreduce/CsvBulkLoadToolIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/mapreduce/CsvBulkLoadToolIT.java b/phoenix-core/src/it/java/org/apache/phoenix/mapreduce/CsvBulkLoadToolIT.java index 392395d..6bcc221 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/mapreduce/CsvBulkLoadToolIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/mapreduce/CsvBulkLoadToolIT.java @@ -39,6 +39,7 @@ import org.apache.phoenix.end2end.NeedsOwnMiniClusterTest; import org.apache.phoenix.jdbc.PhoenixDriver; import org.apache.phoenix.util.DateUtil; import org.apache.phoenix.util.PhoenixRuntime; +import org.apache.phoenix.util.QueryUtil; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; @@ -206,6 +207,8 @@ public class CsvBulkLoadToolIT { String ddl = CREATE LOCAL INDEX TABLE6_IDX ON TABLE6 + (FIRST_NAME ASC); stmt.execute(ddl); +ddl = CREATE LOCAL INDEX TABLE6_IDX2 ON TABLE6 + (LAST_NAME ASC); +stmt.execute(ddl); FileSystem fs = FileSystem.get(hbaseTestUtil.getConfiguration()); FSDataOutputStream outputStream = fs.create(new Path(/tmp/input3.csv)); @@ -228,6 +231,22 @@ public class CsvBulkLoadToolIT { assertEquals(FirstName 2, rs.getString(2)); rs.close(); +rs = +stmt.executeQuery(EXPLAIN SELECT id, FIRST_NAME FROM TABLE6 where first_name='FirstName 2'); +assertEquals( +CLIENT 1-CHUNK PARALLEL 1-WAY RANGE SCAN OVER _LOCAL_IDX_TABLE6 [-32768,'FirstName 2']\n ++ SERVER FILTER BY FIRST KEY ONLY, QueryUtil.getExplainPlan(rs)); +rs.close(); +rs = stmt.executeQuery(SELECT id, LAST_NAME FROM TABLE6 where last_name='LastName 2'); +assertTrue(rs.next()); +assertEquals(2, rs.getInt(1)); +assertEquals(LastName 2, rs.getString(2)); +rs.close(); +rs = +stmt.executeQuery(EXPLAIN SELECT id, LAST_NAME FROM TABLE6 where last_name='LastName 2'); +assertEquals( +CLIENT 1-CHUNK PARALLEL 1-WAY RANGE SCAN OVER _LOCAL_IDX_TABLE6 [-32767,'LastName 2']\n ++ SERVER FILTER BY FIRST KEY ONLY, QueryUtil.getExplainPlan(rs)); stmt.close(); } http://git-wip-us.apache.org/repos/asf/phoenix/blob/4852cee5/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/CsvBulkLoadTool.java -- diff --git a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/CsvBulkLoadTool.java b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/CsvBulkLoadTool.java index 7afde98..83aefaa 100644 --- a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/CsvBulkLoadTool.java +++ b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/CsvBulkLoadTool.java @@ -265,7 +265,7 @@ public class CsvBulkLoadTool extends Configured implements Tool { JobManager.createThreadPoolExec(Integer.MAX_VALUE, 5, 20, useInstrumentedPool); try{ for (TargetTableRef table : tablesToBeLoaded) { - Path tablePath = new Path(outputPath, table.getPhysicalName()); + Path tablePath = new Path(outputPath, table.getLogicalName()); Configuration jobConf = new Configuration(conf); jobConf.set(CsvToKeyValueMapper.TABLE_NAME_CONFKEY, qualifiedTableName); if (qualifiedTableName.compareToIgnoreCase(table.getLogicalName()) != 0) {
phoenix git commit: PHOENIX-2030 CsvBulkLoadTool should use logical name of the table for output directory suffix(Rajeshbabu)
Repository: phoenix Updated Branches: refs/heads/4.4-HBase-0.98 a07c8e37b - 78f5915f9 PHOENIX-2030 CsvBulkLoadTool should use logical name of the table for output directory suffix(Rajeshbabu) Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/78f5915f Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/78f5915f Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/78f5915f Branch: refs/heads/4.4-HBase-0.98 Commit: 78f5915f92c824fd3146a1e9288cb1febb9aa9a0 Parents: a07c8e3 Author: Rajeshbabu Chintaguntla rajeshb...@apache.org Authored: Thu Jun 25 01:19:18 2015 +0530 Committer: Rajeshbabu Chintaguntla rajeshb...@apache.org Committed: Thu Jun 25 01:19:18 2015 +0530 -- .../phoenix/mapreduce/CsvBulkLoadToolIT.java | 19 +++ .../phoenix/mapreduce/CsvBulkLoadTool.java | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/78f5915f/phoenix-core/src/it/java/org/apache/phoenix/mapreduce/CsvBulkLoadToolIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/mapreduce/CsvBulkLoadToolIT.java b/phoenix-core/src/it/java/org/apache/phoenix/mapreduce/CsvBulkLoadToolIT.java index 392395d..6bcc221 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/mapreduce/CsvBulkLoadToolIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/mapreduce/CsvBulkLoadToolIT.java @@ -39,6 +39,7 @@ import org.apache.phoenix.end2end.NeedsOwnMiniClusterTest; import org.apache.phoenix.jdbc.PhoenixDriver; import org.apache.phoenix.util.DateUtil; import org.apache.phoenix.util.PhoenixRuntime; +import org.apache.phoenix.util.QueryUtil; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; @@ -206,6 +207,8 @@ public class CsvBulkLoadToolIT { String ddl = CREATE LOCAL INDEX TABLE6_IDX ON TABLE6 + (FIRST_NAME ASC); stmt.execute(ddl); +ddl = CREATE LOCAL INDEX TABLE6_IDX2 ON TABLE6 + (LAST_NAME ASC); +stmt.execute(ddl); FileSystem fs = FileSystem.get(hbaseTestUtil.getConfiguration()); FSDataOutputStream outputStream = fs.create(new Path(/tmp/input3.csv)); @@ -228,6 +231,22 @@ public class CsvBulkLoadToolIT { assertEquals(FirstName 2, rs.getString(2)); rs.close(); +rs = +stmt.executeQuery(EXPLAIN SELECT id, FIRST_NAME FROM TABLE6 where first_name='FirstName 2'); +assertEquals( +CLIENT 1-CHUNK PARALLEL 1-WAY RANGE SCAN OVER _LOCAL_IDX_TABLE6 [-32768,'FirstName 2']\n ++ SERVER FILTER BY FIRST KEY ONLY, QueryUtil.getExplainPlan(rs)); +rs.close(); +rs = stmt.executeQuery(SELECT id, LAST_NAME FROM TABLE6 where last_name='LastName 2'); +assertTrue(rs.next()); +assertEquals(2, rs.getInt(1)); +assertEquals(LastName 2, rs.getString(2)); +rs.close(); +rs = +stmt.executeQuery(EXPLAIN SELECT id, LAST_NAME FROM TABLE6 where last_name='LastName 2'); +assertEquals( +CLIENT 1-CHUNK PARALLEL 1-WAY RANGE SCAN OVER _LOCAL_IDX_TABLE6 [-32767,'LastName 2']\n ++ SERVER FILTER BY FIRST KEY ONLY, QueryUtil.getExplainPlan(rs)); stmt.close(); } http://git-wip-us.apache.org/repos/asf/phoenix/blob/78f5915f/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/CsvBulkLoadTool.java -- diff --git a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/CsvBulkLoadTool.java b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/CsvBulkLoadTool.java index 7afde98..83aefaa 100644 --- a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/CsvBulkLoadTool.java +++ b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/CsvBulkLoadTool.java @@ -265,7 +265,7 @@ public class CsvBulkLoadTool extends Configured implements Tool { JobManager.createThreadPoolExec(Integer.MAX_VALUE, 5, 20, useInstrumentedPool); try{ for (TargetTableRef table : tablesToBeLoaded) { - Path tablePath = new Path(outputPath, table.getPhysicalName()); + Path tablePath = new Path(outputPath, table.getLogicalName()); Configuration jobConf = new Configuration(conf); jobConf.set(CsvToKeyValueMapper.TABLE_NAME_CONFKEY, qualifiedTableName); if (qualifiedTableName.compareToIgnoreCase(table.getLogicalName()) != 0) {