[jira] [Updated] (PHOENIX-5325) Some pherf tests are failing

2019-06-07 Thread Lars Hofhansl (JIRA)


 [ 
https://issues.apache.org/jira/browse/PHOENIX-5325?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Lars Hofhansl updated PHOENIX-5325:
---
Attachment: 5325-4.x-HBase-1.5.txt

> Some pherf tests are failing
> 
>
> Key: PHOENIX-5325
> URL: https://issues.apache.org/jira/browse/PHOENIX-5325
> Project: Phoenix
>  Issue Type: Test
>Reporter: Lars Hofhansl
>Priority: Major
> Attachments: 5325-4.x-HBase-1.5.txt
>
>
> Exposed by PHOENIX-5316, [~tdsilva]



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (PHOENIX-5325) Some pherf tests are failing

2019-06-07 Thread Lars Hofhansl (JIRA)


 [ 
https://issues.apache.org/jira/browse/PHOENIX-5325?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Lars Hofhansl updated PHOENIX-5325:
---
Attachment: (was: 5325.txt)

> Some pherf tests are failing
> 
>
> Key: PHOENIX-5325
> URL: https://issues.apache.org/jira/browse/PHOENIX-5325
> Project: Phoenix
>  Issue Type: Test
>Reporter: Lars Hofhansl
>Priority: Major
> Attachments: 5325-4.x-HBase-1.5.txt
>
>
> Exposed by PHOENIX-5316, [~tdsilva]



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (PHOENIX-5325) Some pherf tests are failing

2019-06-07 Thread Lars Hofhansl (JIRA)


 [ 
https://issues.apache.org/jira/browse/PHOENIX-5325?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Lars Hofhansl updated PHOENIX-5325:
---
Description: Exposed by PHOENIX-5316, [~tdsilva]  (was: Exposed by 
PHOENIX-5316)

> Some pherf tests are failing
> 
>
> Key: PHOENIX-5325
> URL: https://issues.apache.org/jira/browse/PHOENIX-5325
> Project: Phoenix
>  Issue Type: Test
>Reporter: Lars Hofhansl
>Priority: Major
> Attachments: 5325.txt
>
>
> Exposed by PHOENIX-5316, [~tdsilva]



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (PHOENIX-5325) Some pherf tests are failing

2019-06-07 Thread Lars Hofhansl (JIRA)


 [ 
https://issues.apache.org/jira/browse/PHOENIX-5325?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Lars Hofhansl updated PHOENIX-5325:
---
Description: Exposed by PHOENIX-5316

> Some pherf tests are failing
> 
>
> Key: PHOENIX-5325
> URL: https://issues.apache.org/jira/browse/PHOENIX-5325
> Project: Phoenix
>  Issue Type: Test
>Reporter: Lars Hofhansl
>Priority: Major
> Attachments: 5325.txt
>
>
> Exposed by PHOENIX-5316



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (PHOENIX-5325) Some pherf tests are failing

2019-06-07 Thread Lars Hofhansl (JIRA)


 [ 
https://issues.apache.org/jira/browse/PHOENIX-5325?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Lars Hofhansl updated PHOENIX-5325:
---
Attachment: 5325.txt

> Some pherf tests are failing
> 
>
> Key: PHOENIX-5325
> URL: https://issues.apache.org/jira/browse/PHOENIX-5325
> Project: Phoenix
>  Issue Type: Test
>Reporter: Lars Hofhansl
>Priority: Major
> Attachments: 5325.txt
>
>
> Exposed by PHOENIX-5316



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Created] (PHOENIX-5325) Some pherf tests are failing

2019-06-07 Thread Lars Hofhansl (JIRA)
Lars Hofhansl created PHOENIX-5325:
--

 Summary: Some pherf tests are failing
 Key: PHOENIX-5325
 URL: https://issues.apache.org/jira/browse/PHOENIX-5325
 Project: Phoenix
  Issue Type: Test
Reporter: Lars Hofhansl






--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Created] (PHOENIX-5324) Document: Incorrect syntax DECLARE/OPEN CURSOR

2019-06-07 Thread Karthik Palanisamy (JIRA)
Karthik Palanisamy created PHOENIX-5324:
---

 Summary: Document: Incorrect syntax DECLARE/OPEN CURSOR
 Key: PHOENIX-5324
 URL: https://issues.apache.org/jira/browse/PHOENIX-5324
 Project: Phoenix
  Issue Type: Bug
Affects Versions: 5.0.0
Reporter: Karthik Palanisamy
Assignee: Karthik Palanisamy


Incorrect Syntax:

DECLARE CURSOR [cursorName|https://phoenix.apache.org/language/index.html#name] 
FOR 
[selectStatement|https://phoenix.apache.org/language/index.html#select_statement]

OPEN CURSOR [cursorName|https://phoenix.apache.org/language/index.html#name]

 

Correct Syntax:

DECLARE [cursorName|http://localhost:8000/language/index.html#name] CURSOR FOR 
[selectStatement|http://localhost:8000/language/index.html#select_statement]

OPEN [cursorName|http://localhost:8000/language/index.html#name]

 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (PHOENIX-5156) Consistent Mutable Global Indexes for Non-Transactional Tables

2019-06-07 Thread Gokcen Iskender (JIRA)


 [ 
https://issues.apache.org/jira/browse/PHOENIX-5156?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Gokcen Iskender updated PHOENIX-5156:
-
Attachment: PHOENIX-5156.master.019.patch

> Consistent Mutable Global Indexes for Non-Transactional Tables
> --
>
> Key: PHOENIX-5156
> URL: https://issues.apache.org/jira/browse/PHOENIX-5156
> Project: Phoenix
>  Issue Type: Bug
>Affects Versions: 4.13.0, 4.14.0, 5.0.0, 4.14.1
>Reporter: Kadir OZDEMIR
>Assignee: Kadir OZDEMIR
>Priority: Major
> Attachments: PHOENIX-5156.4.x-HBase-1.4.001.patch, 
> PHOENIX-5156.4.x-HBase-1.4.002.patch, PHOENIX-5156.master.001.patch, 
> PHOENIX-5156.master.002.patch, PHOENIX-5156.master.003.patch, 
> PHOENIX-5156.master.004.patch, PHOENIX-5156.master.005.patch, 
> PHOENIX-5156.master.006.patch, PHOENIX-5156.master.007.patch, 
> PHOENIX-5156.master.008.patch, PHOENIX-5156.master.009.patch, 
> PHOENIX-5156.master.010.patch, PHOENIX-5156.master.011.patch, 
> PHOENIX-5156.master.012.patch, PHOENIX-5156.master.013.patch, 
> PHOENIX-5156.master.014.patch, PHOENIX-5156.master.015.patch, 
> PHOENIX-5156.master.016.patch, PHOENIX-5156.master.017.patch, 
> PHOENIX-5156.master.018.patch, PHOENIX-5156.master.019.patch
>
>  Time Spent: 31h
>  Remaining Estimate: 0h
>
> Without transactional tables, the mutable global indexes can get easily out 
> of sync with their data tables in Phoenix. Transactional tables require a 
> separate transaction manager, have some restrictions and performance 
> penalties. This issue is to have consistent mutable global indexes without 
> the need for using transactional tables.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (PHOENIX-5323) UpgradeIT.testMapTableToNamespaceDuringUpgrade is flapping

2019-06-07 Thread Lars Hofhansl (JIRA)


 [ 
https://issues.apache.org/jira/browse/PHOENIX-5323?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Lars Hofhansl updated PHOENIX-5323:
---
Attachment: 5323.txt

> UpgradeIT.testMapTableToNamespaceDuringUpgrade is flapping
> --
>
> Key: PHOENIX-5323
> URL: https://issues.apache.org/jira/browse/PHOENIX-5323
> Project: Phoenix
>  Issue Type: Test
>Reporter: Lars Hofhansl
>Priority: Major
> Attachments: 5323.txt
>
>
> {quote}
> [ERROR] Tests run: 9, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 
> 94.074 s <<< FAILURE! - in org.apache.phoenix.end2end.UpgradeIT
> [ERROR] 
> testMapTableToNamespaceDuringUpgrade(org.apache.phoenix.end2end.UpgradeIT)  
> Time elapsed: 36.722 s  <<< FAILURE!
> java.lang.AssertionError: expected:<-9223372036854775805> but 
> was:<-9223372036854774707>
>   at 
> org.apache.phoenix.end2end.UpgradeIT.testMapTableToNamespaceDuringUpgrade(UpgradeIT.java:189)
> {quote}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


Re: ArrayIndexOutOfBound while upserting in a view with index on a base table with index

2019-06-07 Thread swaroopa kadam
Filed a jira: https://issues.apache.org/jira/browse/PHOENIX-5322

Thank you.

On Wed, Jun 5, 2019 at 10:01 PM swaroopa kadam 
wrote:

> Hi,
>
> I am trying to upsert a row in a view created on a base table which has
> indexes, also the view has index too. I am getting ArrayIndexOutOfBound
> exception from IndexMaintainer class. Without looking at the code -- my
> hypothesis is code might be trying to update indexes on the base table as
> well for the new row?
>
> java.lang.ArrayIndexOutOfBoundsException: -1
> at java.util.ArrayList.elementData(ArrayList.java:422)
> at java.util.ArrayList.get(ArrayList.java:435)
> at
> org.apache.phoenix.index.IndexMaintainer.initCachedState(IndexMaintainer.java:1619)
> at
> org.apache.phoenix.index.IndexMaintainer.(IndexMaintainer.java:558)
>
> Do we not allow this?
> I am on Phoenix version 4.13 .
>
> Thank you for the help.
>
> --
>
>
> Swaroopa Kadam
> [image: https://]about.me/swaroopa_kadam
> 
>


-- 


Swaroopa Kadam
[image: https://]about.me/swaroopa_kadam



[jira] [Created] (PHOENIX-5323) UpgradeIT.testMapTableToNamespaceDuringUpgrade is flapping

2019-06-07 Thread Lars Hofhansl (JIRA)
Lars Hofhansl created PHOENIX-5323:
--

 Summary: UpgradeIT.testMapTableToNamespaceDuringUpgrade is flapping
 Key: PHOENIX-5323
 URL: https://issues.apache.org/jira/browse/PHOENIX-5323
 Project: Phoenix
  Issue Type: Test
Reporter: Lars Hofhansl


{quote}
[ERROR] Tests run: 9, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 94.074 
s <<< FAILURE! - in org.apache.phoenix.end2end.UpgradeIT
[ERROR] 
testMapTableToNamespaceDuringUpgrade(org.apache.phoenix.end2end.UpgradeIT)  
Time elapsed: 36.722 s  <<< FAILURE!
java.lang.AssertionError: expected:<-9223372036854775805> but 
was:<-9223372036854774707>
at 
org.apache.phoenix.end2end.UpgradeIT.testMapTableToNamespaceDuringUpgrade(UpgradeIT.java:189)
{quote}




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (PHOENIX-5322) Upsert on a view of an indexed table fails with ArrayIndexOutOfBound Exception

2019-06-07 Thread Swaroopa Kadam (JIRA)


 [ 
https://issues.apache.org/jira/browse/PHOENIX-5322?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Swaroopa Kadam updated PHOENIX-5322:

Summary: Upsert on a view of an indexed table fails with 
ArrayIndexOutOfBound Exception  (was: Upsert on a view with indexed table fails 
with ArrayIndexOutOfBound Exception)

> Upsert on a view of an indexed table fails with ArrayIndexOutOfBound Exception
> --
>
> Key: PHOENIX-5322
> URL: https://issues.apache.org/jira/browse/PHOENIX-5322
> Project: Phoenix
>  Issue Type: Bug
>Affects Versions: 4.14.2
>Reporter: Swaroopa Kadam
>Priority: Major
>
> {code:java}
> // code placeholder
> public void testUpstertOnViewWithIndexedTable() throws SQLException {
>Properties prop = new Properties();
>Connection conn = DriverManager.getConnection(getUrl(), prop);
>conn.setAutoCommit(true);
>conn.createStatement().execute("CREATE TABLE IF NOT EXISTS us_population 
> (\n" +
>  "  state CHAR(2) NOT NULL,\n" +
>  "  city VARCHAR NOT NULL,\n" +
>  "  population BIGINT,\n" +
>  "  CONSTRAINT my_pk PRIMARY KEY (state, city)) 
> COLUMN_ENCODED_BYTES=0");
>PreparedStatement ps = conn.prepareStatement("UPSERT INTO us_population 
> VALUES('NY','New York',8143197)");
>ps.executeUpdate();
>ps = conn.prepareStatement("UPSERT INTO us_population VALUES('CA','Los 
> Angeles',3844829)");
>ps.executeUpdate();
>ps = conn.prepareStatement("UPSERT INTO us_population 
> VALUES('IL','Chicago',2842518)");
>ps.executeUpdate();
>ps = conn.prepareStatement("UPSERT INTO us_population 
> VALUES('TX','Houston',2016582)");
>ps.executeUpdate();
>ps = conn.prepareStatement("UPSERT INTO us_population 
> VALUES('PA','Philadelphia',1463281)");
>ps.executeUpdate();
>ps = conn.prepareStatement("UPSERT INTO us_population 
> VALUES('AZ','Phoenix',1461575)");
>ps.executeUpdate();
>ps = conn.prepareStatement("UPSERT INTO us_population VALUES('TX','San 
> Antonio',1256509)");
>ps.executeUpdate();
>ps = conn.prepareStatement("UPSERT INTO us_population VALUES('CA','San 
> Diego',1255540)");
>ps.executeUpdate();
>ps = conn.prepareStatement("UPSERT INTO us_population 
> VALUES('TX','Dallas',1213825)");
>ps.executeUpdate();
>ps = conn.prepareStatement("UPSERT INTO us_population VALUES('CA','San 
> Jose',912332)");
>ps.executeUpdate();
>conn.createStatement().execute("CREATE VIEW IF NOT EXISTS 
> us_population_gv" +
>  "(city_area INTEGER, avg_fam_size INTEGER) AS " +
>  "SELECT * FROM us_population WHERE state = 'CA'");
>conn.createStatement().execute("CREATE INDEX IF NOT EXISTS 
> us_population_gv_gi ON " +
>  "us_population_gv (city_area) INCLUDE (population)");
>conn.createStatement().execute("CREATE INDEX IF NOT EXISTS 
> us_population_gi ON " +
>  "us_population (population)");
>ps = conn.prepareStatement("UPSERT INTO 
> us_population_gv(state,city,population,city_area,avg_fam_size) " +
> "VALUES('CA','Santa Barbara',912332,1300,4)");
>ps.executeUpdate();
> }
> {code}
> Exception: 
> java.lang.ArrayIndexOutOfBoundsException: -1
>   at java.util.ArrayList.elementData(ArrayList.java:422)
>   at java.util.ArrayList.get(ArrayList.java:435)
>   at 
> org.apache.phoenix.index.IndexMaintainer.initCachedState(IndexMaintainer.java:1631)
>   at 
> org.apache.phoenix.index.IndexMaintainer.(IndexMaintainer.java:564)
>   at 
> org.apache.phoenix.index.IndexMaintainer.create(IndexMaintainer.java:144)
>   at 
> org.apache.phoenix.schema.PTableImpl.getIndexMaintainer(PTableImpl.java:1499)
>   at 
> org.apache.phoenix.index.IndexMaintainer.serialize(IndexMaintainer.java:226)
>   at 
> org.apache.phoenix.index.IndexMaintainer.serializeServerMaintainedIndexes(IndexMaintainer.java:203)
>   at 
> org.apache.phoenix.index.IndexMaintainer.serialize(IndexMaintainer.java:187)
>   at 
> org.apache.phoenix.schema.PTableImpl.getIndexMaintainers(PTableImpl.java:1511)
>   at org.apache.phoenix.execute.MutationState.send(MutationState.java:963)
>   at 
> org.apache.phoenix.execute.MutationState.send(MutationState.java:1432)
>   at 
> org.apache.phoenix.execute.MutationState.commit(MutationState.java:1255)
>   at 
> org.apache.phoenix.jdbc.PhoenixConnection$3.call(PhoenixConnection.java:673)
>   at 
> org.apache.phoenix.jdbc.PhoenixConnection$3.call(PhoenixConnection.java:669)
>   at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53)
>   at 
> org.apache.phoenix.jdbc.PhoenixConnection.commit(PhoenixConnection.java:669)
>   at 
> org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:412)
>   at 
> 

[jira] [Updated] (PHOENIX-5322) Upsert on a view with indexed table fails with ArrayIndexOutOfBound Exception

2019-06-07 Thread Swaroopa Kadam (JIRA)


 [ 
https://issues.apache.org/jira/browse/PHOENIX-5322?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Swaroopa Kadam updated PHOENIX-5322:

Description: 
{code:java}
// code placeholder
public void testUpstertOnViewWithIndexedTable() throws SQLException {

   Properties prop = new Properties();
   Connection conn = DriverManager.getConnection(getUrl(), prop);
   conn.setAutoCommit(true);
   conn.createStatement().execute("CREATE TABLE IF NOT EXISTS us_population 
(\n" +
 "  state CHAR(2) NOT NULL,\n" +
 "  city VARCHAR NOT NULL,\n" +
 "  population BIGINT,\n" +
 "  CONSTRAINT my_pk PRIMARY KEY (state, city)) 
COLUMN_ENCODED_BYTES=0");

   PreparedStatement ps = conn.prepareStatement("UPSERT INTO us_population 
VALUES('NY','New York',8143197)");
   ps.executeUpdate();
   ps = conn.prepareStatement("UPSERT INTO us_population VALUES('CA','Los 
Angeles',3844829)");
   ps.executeUpdate();
   ps = conn.prepareStatement("UPSERT INTO us_population 
VALUES('IL','Chicago',2842518)");
   ps.executeUpdate();
   ps = conn.prepareStatement("UPSERT INTO us_population 
VALUES('TX','Houston',2016582)");
   ps.executeUpdate();
   ps = conn.prepareStatement("UPSERT INTO us_population 
VALUES('PA','Philadelphia',1463281)");
   ps.executeUpdate();
   ps = conn.prepareStatement("UPSERT INTO us_population 
VALUES('AZ','Phoenix',1461575)");
   ps.executeUpdate();
   ps = conn.prepareStatement("UPSERT INTO us_population VALUES('TX','San 
Antonio',1256509)");
   ps.executeUpdate();
   ps = conn.prepareStatement("UPSERT INTO us_population VALUES('CA','San 
Diego',1255540)");
   ps.executeUpdate();
   ps = conn.prepareStatement("UPSERT INTO us_population 
VALUES('TX','Dallas',1213825)");
   ps.executeUpdate();
   ps = conn.prepareStatement("UPSERT INTO us_population VALUES('CA','San 
Jose',912332)");
   ps.executeUpdate();

   conn.createStatement().execute("CREATE VIEW IF NOT EXISTS us_population_gv" +
 "(city_area INTEGER, avg_fam_size INTEGER) AS " +
 "SELECT * FROM us_population WHERE state = 'CA'");

   conn.createStatement().execute("CREATE INDEX IF NOT EXISTS 
us_population_gv_gi ON " +
 "us_population_gv (city_area) INCLUDE (population)");

   conn.createStatement().execute("CREATE INDEX IF NOT EXISTS us_population_gi 
ON " +
 "us_population (population)");
   ps = conn.prepareStatement("UPSERT INTO 
us_population_gv(state,city,population,city_area,avg_fam_size) " +
"VALUES('CA','Santa Barbara',912332,1300,4)");

   ps.executeUpdate();
}
{code}

Exception: 

java.lang.ArrayIndexOutOfBoundsException: -1

at java.util.ArrayList.elementData(ArrayList.java:422)
at java.util.ArrayList.get(ArrayList.java:435)
at 
org.apache.phoenix.index.IndexMaintainer.initCachedState(IndexMaintainer.java:1631)
at 
org.apache.phoenix.index.IndexMaintainer.(IndexMaintainer.java:564)
at 
org.apache.phoenix.index.IndexMaintainer.create(IndexMaintainer.java:144)
at 
org.apache.phoenix.schema.PTableImpl.getIndexMaintainer(PTableImpl.java:1499)
at 
org.apache.phoenix.index.IndexMaintainer.serialize(IndexMaintainer.java:226)
at 
org.apache.phoenix.index.IndexMaintainer.serializeServerMaintainedIndexes(IndexMaintainer.java:203)
at 
org.apache.phoenix.index.IndexMaintainer.serialize(IndexMaintainer.java:187)
at 
org.apache.phoenix.schema.PTableImpl.getIndexMaintainers(PTableImpl.java:1511)
at org.apache.phoenix.execute.MutationState.send(MutationState.java:963)
at 
org.apache.phoenix.execute.MutationState.send(MutationState.java:1432)
at 
org.apache.phoenix.execute.MutationState.commit(MutationState.java:1255)
at 
org.apache.phoenix.jdbc.PhoenixConnection$3.call(PhoenixConnection.java:673)
at 
org.apache.phoenix.jdbc.PhoenixConnection$3.call(PhoenixConnection.java:669)
at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53)
at 
org.apache.phoenix.jdbc.PhoenixConnection.commit(PhoenixConnection.java:669)
at 
org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:412)
at 
org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:392)
at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53)
at 
org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStatement.java:391)
at 
org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStatement.java:379)
at 
org.apache.phoenix.jdbc.PhoenixPreparedStatement.executeUpdate(PhoenixPreparedStatement.java:206)
at 
org.apache.phoenix.end2end.ParameterizedAlterTableCascade2IT.testUpstertOnViewWithIndexedTable(ParameterizedAlterTableCascade2IT.java:55)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at 

[jira] [Created] (PHOENIX-5322) Upsert on a view with indexed table fails with ArrayIndexOutOfBound Exception

2019-06-07 Thread Swaroopa Kadam (JIRA)
Swaroopa Kadam created PHOENIX-5322:
---

 Summary: Upsert on a view with indexed table fails with 
ArrayIndexOutOfBound Exception
 Key: PHOENIX-5322
 URL: https://issues.apache.org/jira/browse/PHOENIX-5322
 Project: Phoenix
  Issue Type: Bug
Affects Versions: 4.14.2
Reporter: Swaroopa Kadam


{code:java}
// code placeholder
public void testUpstertOnViewWithIndexedTable() throws SQLException {

   Properties prop = new Properties();
   Connection conn = DriverManager.getConnection(getUrl(), prop);
   conn.setAutoCommit(true);
   conn.createStatement().execute("CREATE TABLE IF NOT EXISTS us_population 
(\n" +
 "  state CHAR(2) NOT NULL,\n" +
 "  city VARCHAR NOT NULL,\n" +
 "  population BIGINT,\n" +
 "  CONSTRAINT my_pk PRIMARY KEY (state, city)) 
COLUMN_ENCODED_BYTES=0");

   PreparedStatement ps = conn.prepareStatement("UPSERT INTO us_population 
VALUES('NY','New York',8143197)");
   ps.executeUpdate();
   ps = conn.prepareStatement("UPSERT INTO us_population VALUES('CA','Los 
Angeles',3844829)");
   ps.executeUpdate();
   ps = conn.prepareStatement("UPSERT INTO us_population 
VALUES('IL','Chicago',2842518)");
   ps.executeUpdate();
   ps = conn.prepareStatement("UPSERT INTO us_population 
VALUES('TX','Houston',2016582)");
   ps.executeUpdate();
   ps = conn.prepareStatement("UPSERT INTO us_population 
VALUES('PA','Philadelphia',1463281)");
   ps.executeUpdate();
   ps = conn.prepareStatement("UPSERT INTO us_population 
VALUES('AZ','Phoenix',1461575)");
   ps.executeUpdate();
   ps = conn.prepareStatement("UPSERT INTO us_population VALUES('TX','San 
Antonio',1256509)");
   ps.executeUpdate();
   ps = conn.prepareStatement("UPSERT INTO us_population VALUES('CA','San 
Diego',1255540)");
   ps.executeUpdate();
   ps = conn.prepareStatement("UPSERT INTO us_population 
VALUES('TX','Dallas',1213825)");
   ps.executeUpdate();
   ps = conn.prepareStatement("UPSERT INTO us_population VALUES('CA','San 
Jose',912332)");
   ps.executeUpdate();

   conn.createStatement().execute("CREATE VIEW IF NOT EXISTS us_population_gv" +
 "(city_area INTEGER, avg_fam_size INTEGER) AS " +
 "SELECT * FROM us_population WHERE state = 'CA'");

   conn.createStatement().execute("CREATE INDEX IF NOT EXISTS 
us_population_gv_gi ON " +
 "us_population_gv (city_area) INCLUDE (population)");

   conn.createStatement().execute("CREATE INDEX IF NOT EXISTS us_population_gi 
ON " +
 "us_population (population)");
   ps = conn.prepareStatement("UPSERT INTO 
us_population_gv(state,city,population,city_area,avg_fam_size) " +
"VALUES('CA','Santa Barbara',912332,1300,4)");

   ps.executeUpdate();
}
{code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (PHOENIX-5122) PHOENIX-4322 breaks client backward compatibility

2019-06-07 Thread Thomas D'Silva (JIRA)


 [ 
https://issues.apache.org/jira/browse/PHOENIX-5122?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Thomas D'Silva updated PHOENIX-5122:

Fix Version/s: (was: 5.0.1)

> PHOENIX-4322 breaks client backward compatibility
> -
>
> Key: PHOENIX-5122
> URL: https://issues.apache.org/jira/browse/PHOENIX-5122
> Project: Phoenix
>  Issue Type: Bug
>Affects Versions: 4.13.0
>Reporter: Jacob Isaac
>Assignee: Jacob Isaac
>Priority: Blocker
> Fix For: 4.15.0, 5.1.0, 4.14.3
>
> Attachments: PHOENIX-5122-4.x-HBase-1.3.patch, 
> PHOENIX-5122-4.x-HBase-1.3_addendum.patch, PHOENIX-5122-addendum-tests.zip, 
> PHOENIX-5122.patch, Screen Shot 2019-03-04 at 6.17.42 PM.png, Screen Shot 
> 2019-03-04 at 6.21.10 PM.png
>
>  Time Spent: 1h 40m
>  Remaining Estimate: 0h
>
> Scenario :
> *4.13 client -> 4.14.1 server*
> {noformat}
> Connected to: Phoenix (version 4.13)
> Driver: PhoenixEmbeddedDriver (version 4.13)
> Autocommit status: true
> Transaction isolation: TRANSACTION_READ_COMMITTED
> Building list of tables and columns for tab-completion (set fastconnect to 
> true to skip)...
> 135/135 (100%) Done
> Done
> sqlline version 1.1.9
> 0: jdbc:phoenix:localhost> 
> 0: jdbc:phoenix:localhost> 
> 0: jdbc:phoenix:localhost> CREATE table P_T02 (oid VARCHAR NOT NULL, code 
> VARCHAR NOT NULL constraint pk primary key (oid DESC, code DESC));
> No rows affected (1.31 seconds)
> 0: jdbc:phoenix:localhost> 
> 0: jdbc:phoenix:localhost> upsert into P_T02 (oid, code) values ('0001', 
> 'v0001');
> 1 row affected (0.033 seconds)
> 0: jdbc:phoenix:localhost> upsert into P_T02 (oid, code) values ('0002', 
> 'v0002');
> 1 row affected (0.004 seconds)
> 0: jdbc:phoenix:localhost> 
> 0: jdbc:phoenix:localhost> select * from P_T02 where (oid, code) IN 
> (('0001', 'v0001'), ('0002', 'v0002'));
> +--+--+
> | OID | CODE |
> +--+--+
> +--+--+
> {color:#FF}+*No rows selected (0.033 seconds)*+{color}
> 0: jdbc:phoenix:localhost> select * from P_T02 ;
> +--+--+
> | OID | CODE |
> +--+--+
> | 0002 | v0002 |
> | 0001 | v0001 |
> +--+--+
> 2 rows selected (0.016 seconds)
> 0: jdbc:phoenix:localhost>
>  {noformat}
> *4.14.1 client -> 4.14.1 server* 
> {noformat}
> Connected to: Phoenix (version 4.14)
> Driver: PhoenixEmbeddedDriver (version 4.14)
> Autocommit status: true
> Transaction isolation: TRANSACTION_READ_COMMITTED
> Building list of tables and columns for tab-completion (set fastconnect to 
> true to skip)...
> 133/133 (100%) Done
> Done
> sqlline version 1.1.9
> 0: jdbc:phoenix:localhost> 
> 0: jdbc:phoenix:localhost> CREATE table P_T01 (oid VARCHAR NOT NULL, code 
> VARCHAR NOT NULL constraint pk primary key (oid DESC, code DESC));
> No rows affected (1.273 seconds)
> 0: jdbc:phoenix:localhost> 
> 0: jdbc:phoenix:localhost> upsert into P_T01 (oid, code) values ('0001', 
> 'v0001');
> 1 row affected (0.056 seconds)
> 0: jdbc:phoenix:localhost> upsert into P_T01 (oid, code) values ('0002', 
> 'v0002');
> 1 row affected (0.004 seconds)
> 0: jdbc:phoenix:localhost> 
> 0: jdbc:phoenix:localhost> select * from P_T01 where (oid, code) IN 
> (('0001', 'v0001'), ('0002', 'v0002'));
> +--+--+
> | OID | CODE |
> +--+--+
> | 0002 | v0002 |
> | 0001 | v0001 |
> +--+--+
> 2 rows selected (0.051 seconds)
> 0: jdbc:phoenix:localhost> select * from P_T01 ;
> +--+--+
> | OID | CODE |
> +--+--+
> | 0002 | v0002 |
> | 0001 | v0001 |
> +--+--+
> 2 rows selected (0.017 seconds)
> 0: jdbc:phoenix:localhost>
> {noformat}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (PHOENIX-5156) Consistent Mutable Global Indexes for Non-Transactional Tables

2019-06-07 Thread Kadir OZDEMIR (JIRA)


 [ 
https://issues.apache.org/jira/browse/PHOENIX-5156?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Kadir OZDEMIR updated PHOENIX-5156:
---
Attachment: PHOENIX-5156.master.018.patch

> Consistent Mutable Global Indexes for Non-Transactional Tables
> --
>
> Key: PHOENIX-5156
> URL: https://issues.apache.org/jira/browse/PHOENIX-5156
> Project: Phoenix
>  Issue Type: Bug
>Affects Versions: 4.13.0, 4.14.0, 5.0.0, 4.14.1
>Reporter: Kadir OZDEMIR
>Assignee: Kadir OZDEMIR
>Priority: Major
> Attachments: PHOENIX-5156.4.x-HBase-1.4.001.patch, 
> PHOENIX-5156.4.x-HBase-1.4.002.patch, PHOENIX-5156.master.001.patch, 
> PHOENIX-5156.master.002.patch, PHOENIX-5156.master.003.patch, 
> PHOENIX-5156.master.004.patch, PHOENIX-5156.master.005.patch, 
> PHOENIX-5156.master.006.patch, PHOENIX-5156.master.007.patch, 
> PHOENIX-5156.master.008.patch, PHOENIX-5156.master.009.patch, 
> PHOENIX-5156.master.010.patch, PHOENIX-5156.master.011.patch, 
> PHOENIX-5156.master.012.patch, PHOENIX-5156.master.013.patch, 
> PHOENIX-5156.master.014.patch, PHOENIX-5156.master.015.patch, 
> PHOENIX-5156.master.016.patch, PHOENIX-5156.master.017.patch, 
> PHOENIX-5156.master.018.patch
>
>  Time Spent: 31h
>  Remaining Estimate: 0h
>
> Without transactional tables, the mutable global indexes can get easily out 
> of sync with their data tables in Phoenix. Transactional tables require a 
> separate transaction manager, have some restrictions and performance 
> penalties. This issue is to have consistent mutable global indexes without 
> the need for using transactional tables.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (PHOENIX-5317) Upserting rows into child views with pk fails when the base view has an index on it.

2019-06-07 Thread Jacob Isaac (JIRA)


 [ 
https://issues.apache.org/jira/browse/PHOENIX-5317?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jacob Isaac updated PHOENIX-5317:
-
Attachment: PHOENIX-5137-TestFailure.txt

> Upserting rows into child views with pk fails when the base view has an index 
> on it.
> 
>
> Key: PHOENIX-5317
> URL: https://issues.apache.org/jira/browse/PHOENIX-5317
> Project: Phoenix
>  Issue Type: Sub-task
>Affects Versions: 4.13.0, 4.14.1
>Reporter: Jacob Isaac
>Priority: Major
> Attachments: PHOENIX-5137-TestFailure.txt
>
>
> Steps to reproduce - 
> 1 Create Base Table, Base/Global View and Index using non tenanted connection.
> CREATE TABLE IF NOT EXISTS TEST.BASETABLE (
> TENANT_ID CHAR(15) NOT NULL, 
> KEY_PREFIX CHAR(3) NOT NULL, 
> CREATED_DATE DATE,
> CREATED_BY CHAR(15),
> SYSTEM_MODSTAMP DATE
> CONSTRAINT PK PRIMARY KEY (
> TENANT_ID, 
> KEY_PREFIX 
> )
> ) VERSIONS=1, MULTI_TENANT=true, IMMUTABLE_ROWS=TRUE, REPLICATION_SCOPE=1;
> CREATE VIEW IF NOT EXISTS TEST.MY_GLOBAL_VIEW  (
> TEXT1 VARCHAR NOT NULL,
> INT1 BIGINT NOT NULL,
> DOUBLE1 DECIMAL(12, 3),
> IS_BOOLEAN BOOLEAN,
> RELATIONSHIP_ID CHAR(15),
> TEXT_READ_ONLY VARCHAR,
> DATE_TIME1 DATE,
> JSON1 VARCHAR,
> IP_START_ADDRESS VARCHAR
> CONSTRAINT PKVIEW PRIMARY KEY
> (
> TEXT1, INT1
> )
> )
> AS SELECT * FROM TEST.BASETABLE WHERE KEY_PREFIX = '0CY';
> CREATE INDEX IF NOT EXISTS TEST_MY_GLOBAL_VIEW_SEC_INDEX
> ON TEST.MY_GLOBAL_VIEW (TEXT1, INT1)
> INCLUDE (CREATED_BY, RELATIONSHIP_ID, JSON1, DOUBLE1, IS_BOOLEAN, 
> IP_START_ADDRESS, CREATED_DATE, SYSTEM_MODSTAMP, TEXT_READ_ONLY);
> 2. Create child view using an tenant-owned connection
> CREATE VIEW IF NOT EXISTS TEST."z01" (COL1 VARCHAR, COL2 VARCHAR, COL3 
> VARCHAR, COL4 VARCHAR CONSTRAINT PK PRIMARY KEY (COL1, COL2, COL3, COL4)) AS 
> SELECT * FROM TEST.MY_GLOBAL_VIEW; 
> 3. Upsert into child view
> UPSERT INTO TEST."z01" (DATE_TIME1, INT1, TEXT1, COL1, COL2, COL3, COL4) 
> VALUES (TO_DATE('2017-10-16 22:00:00', '-MM-dd HH:mm:ss'), 10, 'z', 
> '8', 'z', 'z', 'z');
> Following exception is thrown -
> 0: jdbc:phoenix:localhost> UPSERT INTO TEST."z01" (DATE_TIME1, INT1, TEXT1, 
> COL1, COL2, COL3, COL4) VALUES (TO_DATE('2017-10-16 22:00:00', '-MM-dd 
> HH:mm:ss'), 10, 'z', '8', 'z', 'z', 'z');
> java.lang.IllegalArgumentException
>   at 
> com.google.common.base.Preconditions.checkArgument(Preconditions.java:76)
>   at 
> com.google.common.collect.Lists.computeArrayListCapacity(Lists.java:105)
>   at 
> com.google.common.collect.Lists.newArrayListWithExpectedSize(Lists.java:195)
>   at 
> org.apache.phoenix.index.IndexMaintainer.(IndexMaintainer.java:424)
>   at 
> org.apache.phoenix.index.IndexMaintainer.create(IndexMaintainer.java:143)
>   at 
> org.apache.phoenix.schema.PTableImpl.getIndexMaintainer(PTableImpl.java:1176)
>   at 
> org.apache.phoenix.util.IndexUtil.generateIndexData(IndexUtil.java:303)
>   at 
> org.apache.phoenix.execute.MutationState$1.next(MutationState.java:519)
>   at 
> org.apache.phoenix.execute.MutationState$1.next(MutationState.java:501)
>   at org.apache.phoenix.execute.MutationState.send(MutationState.java:941)
>   at 
> org.apache.phoenix.execute.MutationState.send(MutationState.java:1387)
>   at 
> org.apache.phoenix.execute.MutationState.commit(MutationState.java:1228)
>   at 
> org.apache.phoenix.jdbc.PhoenixConnection$3.call(PhoenixConnection.java:666)
>   at 
> org.apache.phoenix.jdbc.PhoenixConnection$3.call(PhoenixConnection.java:662)
>   at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53)
>   at 
> org.apache.phoenix.jdbc.PhoenixConnection.commit(PhoenixConnection.java:662)
>   at 
> org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:399)
>   at 
> org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:379)
>   at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53)
>   at 
> org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStatement.java:378)
>   at 
> org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStatement.java:366)
>   at 
> org.apache.phoenix.jdbc.PhoenixStatement.execute(PhoenixStatement.java:1775)
>   at sqlline.Commands.execute(Commands.java:822)
>   at sqlline.Commands.sql(Commands.java:732)
>   at sqlline.SqlLine.dispatch(SqlLine.java:807)
>   at sqlline.SqlLine.begin(SqlLine.java:681)
>   at sqlline.SqlLine.start(SqlLine.java:398)
>   at sqlline.SqlLine.main(SqlLine.java:292)



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Resolved] (PHOENIX-5320) Run SortMergeJoinNoSpoolingIT in own mini cluster.

2019-06-07 Thread Lars Hofhansl (JIRA)


 [ 
https://issues.apache.org/jira/browse/PHOENIX-5320?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Lars Hofhansl resolved PHOENIX-5320.

   Resolution: Fixed
Fix Version/s: 5.1.0
   4.15.0

> Run SortMergeJoinNoSpoolingIT in own mini cluster.
> --
>
> Key: PHOENIX-5320
> URL: https://issues.apache.org/jira/browse/PHOENIX-5320
> Project: Phoenix
>  Issue Type: Test
>Reporter: Lars Hofhansl
>Assignee: Lars Hofhansl
>Priority: Major
> Fix For: 4.15.0, 5.1.0
>
> Attachments: 5320-v2.txt, 5320.txt
>
>
> {code:java}
> Error Message
> Expected PhoenixIOException due to IllegalStateException
> Stacktrace
> java.lang.AssertionError: Expected PhoenixIOException due to 
> IllegalStateException
> at 
> org.apache.phoenix.end2end.join.SortMergeJoinNoSpoolingIT.testJoinWithMemoryLimit(SortMergeJoinNoSpoolingIT.java:74){code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (PHOENIX-5320) Run SortMergeJoinNoSpoolingIT in own mini cluster.

2019-06-07 Thread Lars Hofhansl (JIRA)


 [ 
https://issues.apache.org/jira/browse/PHOENIX-5320?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Lars Hofhansl updated PHOENIX-5320:
---
Summary: Run SortMergeJoinNoSpoolingIT in own mini cluster.  (was: 
SortMergeJoinNoSpoolingIT fails occasionally.)

> Run SortMergeJoinNoSpoolingIT in own mini cluster.
> --
>
> Key: PHOENIX-5320
> URL: https://issues.apache.org/jira/browse/PHOENIX-5320
> Project: Phoenix
>  Issue Type: Test
>Reporter: Lars Hofhansl
>Assignee: Lars Hofhansl
>Priority: Major
> Attachments: 5320-v2.txt, 5320.txt
>
>
> {code:java}
> Error Message
> Expected PhoenixIOException due to IllegalStateException
> Stacktrace
> java.lang.AssertionError: Expected PhoenixIOException due to 
> IllegalStateException
> at 
> org.apache.phoenix.end2end.join.SortMergeJoinNoSpoolingIT.testJoinWithMemoryLimit(SortMergeJoinNoSpoolingIT.java:74){code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (PHOENIX-5156) Consistent Mutable Global Indexes for Non-Transactional Tables

2019-06-07 Thread Kadir OZDEMIR (JIRA)


 [ 
https://issues.apache.org/jira/browse/PHOENIX-5156?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Kadir OZDEMIR updated PHOENIX-5156:
---
Attachment: PHOENIX-5156.4.x-HBase-1.4.002.patch

> Consistent Mutable Global Indexes for Non-Transactional Tables
> --
>
> Key: PHOENIX-5156
> URL: https://issues.apache.org/jira/browse/PHOENIX-5156
> Project: Phoenix
>  Issue Type: Bug
>Affects Versions: 4.13.0, 4.14.0, 5.0.0, 4.14.1
>Reporter: Kadir OZDEMIR
>Assignee: Kadir OZDEMIR
>Priority: Major
> Attachments: PHOENIX-5156.4.x-HBase-1.4.001.patch, 
> PHOENIX-5156.4.x-HBase-1.4.002.patch, PHOENIX-5156.master.001.patch, 
> PHOENIX-5156.master.002.patch, PHOENIX-5156.master.003.patch, 
> PHOENIX-5156.master.004.patch, PHOENIX-5156.master.005.patch, 
> PHOENIX-5156.master.006.patch, PHOENIX-5156.master.007.patch, 
> PHOENIX-5156.master.008.patch, PHOENIX-5156.master.009.patch, 
> PHOENIX-5156.master.010.patch, PHOENIX-5156.master.011.patch, 
> PHOENIX-5156.master.012.patch, PHOENIX-5156.master.013.patch, 
> PHOENIX-5156.master.014.patch, PHOENIX-5156.master.015.patch, 
> PHOENIX-5156.master.016.patch, PHOENIX-5156.master.017.patch
>
>  Time Spent: 31h
>  Remaining Estimate: 0h
>
> Without transactional tables, the mutable global indexes can get easily out 
> of sync with their data tables in Phoenix. Transactional tables require a 
> separate transaction manager, have some restrictions and performance 
> penalties. This issue is to have consistent mutable global indexes without 
> the need for using transactional tables.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)