[jira] [Commented] (PHOENIX-6434) Secondary Indexes on PHOENIX_ROW_TIMESTAMP()

2021-04-22 Thread Kadir Ozdemir (Jira)


[ 
https://issues.apache.org/jira/browse/PHOENIX-6434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17329954#comment-17329954
 ] 

Kadir Ozdemir commented on PHOENIX-6434:


[~larsh], I missed 5.1 and just cherry picked from master to 5.1. Thanks for 
catching it.

> Secondary Indexes on PHOENIX_ROW_TIMESTAMP()
> 
>
> Key: PHOENIX-6434
> URL: https://issues.apache.org/jira/browse/PHOENIX-6434
> Project: Phoenix
>  Issue Type: Improvement
>Affects Versions: 5.1.0, 4.16.0
>Reporter: Kadir Ozdemir
>Priority: Major
> Fix For: 4.16.1, 5.2.0, 5.1.2
>
> Attachments: PHOENIX-6434.4.x.001.patch, PHOENIX-6434.4.x.002.patch, 
> PHOENIX-6434.4.x.003.patch, PHOENIX-6434.4.x.004.patch, 
> PHOENIX-6434.master.001.patch, PHOENIX-6434.master.002.patch
>
>
> PHOENIX-5629 introduced the function PHOENIX_ROW_TIMESTAMP() that returns the 
> last modified time of a row. PHOENIX_ROW_TIMESTAMP() can be used as a 
> projection column and referred in a WHERE clause. It is desirable to have 
> indexes on row timestamps. This will result in fast time range queries. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (PHOENIX-6434) Secondary Indexes on PHOENIX_ROW_TIMESTAMP()

2021-04-22 Thread Lars Hofhansl (Jira)


[ 
https://issues.apache.org/jira/browse/PHOENIX-6434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17329519#comment-17329519
 ] 

Lars Hofhansl commented on PHOENIX-6434:


It's resolved, but I do not see it in the 5.1 branch, yet.

> Secondary Indexes on PHOENIX_ROW_TIMESTAMP()
> 
>
> Key: PHOENIX-6434
> URL: https://issues.apache.org/jira/browse/PHOENIX-6434
> Project: Phoenix
>  Issue Type: Improvement
>Affects Versions: 5.1.0, 4.16.0
>Reporter: Kadir Ozdemir
>Priority: Major
> Attachments: PHOENIX-6434.4.x.001.patch, PHOENIX-6434.4.x.002.patch, 
> PHOENIX-6434.4.x.003.patch, PHOENIX-6434.4.x.004.patch, 
> PHOENIX-6434.master.001.patch, PHOENIX-6434.master.002.patch
>
>
> PHOENIX-5629 introduced the function PHOENIX_ROW_TIMESTAMP() that returns the 
> last modified time of a row. PHOENIX_ROW_TIMESTAMP() can be used as a 
> projection column and referred in a WHERE clause. It is desirable to have 
> indexes on row timestamps. This will result in fast time range queries. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (PHOENIX-6434) Secondary Indexes on PHOENIX_ROW_TIMESTAMP()

2021-04-21 Thread Hadoop QA (Jira)


[ 
https://issues.apache.org/jira/browse/PHOENIX-6434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17327111#comment-17327111
 ] 

Hadoop QA commented on PHOENIX-6434:


| (x) *{color:red}-1 overall{color}* |
\\
\\
|| Vote || Subsystem || Runtime || Comment ||
| {color:blue}0{color} | {color:blue} reexec {color} | {color:blue}  6m  
7s{color} | {color:blue} Docker mode activated. {color} |
|| || || || {color:brown} Prechecks {color} ||
| {color:green}+1{color} | {color:green} dupname {color} | {color:green}  0m  
0s{color} | {color:green} No case conflicting files found. {color} |
| {color:green}+1{color} | {color:green} hbaseanti {color} | {color:green}  0m  
0s{color} | {color:green} Patch does not have any anti-patterns. {color} |
| {color:green}+1{color} | {color:green} @author {color} | {color:green}  0m  
0s{color} | {color:green} The patch does not contain any @author tags. {color} |
| {color:green}+1{color} | {color:green} test4tests {color} | {color:green}  0m 
 0s{color} | {color:green} The patch appears to include 1 new or modified test 
files. {color} |
|| || || || {color:brown} master Compile Tests {color} ||
| {color:green}+1{color} | {color:green} mvninstall {color} | {color:green} 10m 
26s{color} | {color:green} master passed {color} |
| {color:black}+0{color} | {color:black} hbaserecompile {color} | {color:black} 
17m 21s{color} | {color:black} HBase recompiled. {color} |
| {color:green}+1{color} | {color:green} compile {color} | {color:green}  1m  
2s{color} | {color:green} master passed {color} |
| {color:green}+1{color} | {color:green} checkstyle {color} | {color:green}  2m 
32s{color} | {color:green} master passed {color} |
| {color:green}+1{color} | {color:green} javadoc {color} | {color:green}  0m 
49s{color} | {color:green} master passed {color} |
| {color:blue}0{color} | {color:blue} spotbugs {color} | {color:blue}  3m 
11s{color} | {color:blue} phoenix-core in master has 960 extant spotbugs 
warnings. {color} |
|| || || || {color:brown} Patch Compile Tests {color} ||
| {color:green}+1{color} | {color:green} mvninstall {color} | {color:green}  9m 
42s{color} | {color:green} the patch passed {color} |
| {color:black}+0{color} | {color:black} hbaserecompile {color} | {color:black} 
19m 47s{color} | {color:black} HBase recompiled. {color} |
| {color:green}+1{color} | {color:green} compile {color} | {color:green}  1m  
2s{color} | {color:green} the patch passed {color} |
| {color:green}+1{color} | {color:green} javac {color} | {color:green}  1m  
2s{color} | {color:green} the patch passed {color} |
| {color:red}-1{color} | {color:red} checkstyle {color} | {color:red}  2m 
34s{color} | {color:red} phoenix-core: The patch generated 69 new + 7458 
unchanged - 22 fixed = 7527 total (was 7480) {color} |
| {color:red}-1{color} | {color:red} whitespace {color} | {color:red}  0m  
0s{color} | {color:red} The patch 1 line(s) with tabs. {color} |
| {color:green}+1{color} | {color:green} javadoc {color} | {color:green}  0m 
49s{color} | {color:green} the patch passed {color} |
| {color:green}+1{color} | {color:green} spotbugs {color} | {color:green}  3m 
24s{color} | {color:green} the patch passed {color} |
|| || || || {color:brown} Other Tests {color} ||
| {color:red}-1{color} | {color:red} unit {color} | {color:red}227m 32s{color} 
| {color:red} phoenix-core in the patch failed. {color} |
| {color:green}+1{color} | {color:green} asflicense {color} | {color:green}  0m 
31s{color} | {color:green} The patch does not generate ASF License warnings. 
{color} |
| {color:black}{color} | {color:black} {color} | {color:black}284m  4s{color} | 
{color:black} {color} |
\\
\\
|| Reason || Tests ||
| Failed junit tests | phoenix.schema.stats.NamespaceDisabledStatsCollectorIT |
|   | phoenix.schema.stats.NamespaceEnabledStatsCollectorIT |
|   | phoenix.schema.stats.TxStatsCollectorIT |
|   | phoenix.end2end.PermissionNSDisabledWithCustomAccessControllerIT |
|   | phoenix.schema.stats.NonTxStatsCollectorIT |
\\
\\
|| Subsystem || Report/Notes ||
| Docker | ClientAPI=1.41 ServerAPI=1.41 base: 
https://ci-hadoop.apache.org/job/PreCommit-PHOENIX-Build/390/artifact/patchprocess/Dockerfile
 |
| JIRA Issue | PHOENIX-6434 |
| JIRA Patch URL | 
https://issues.apache.org/jira/secure/attachment/13024414/PHOENIX-6434.master.002.patch
 |
| Optional Tests | dupname asflicense javac javadoc unit spotbugs hbaserebuild 
hbaseanti checkstyle compile |
| uname | Linux 0d1398cea33a 4.15.0-101-generic #102-Ubuntu SMP Mon May 11 
10:07:26 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux |
| Build tool | maven |
| Personality | dev/phoenix-personality.sh |
| git revision | master / 93db2fc |
| Default Java | Private Build-1.8.0_242-8u242-b08-0ubuntu3~16.04-b08 |
| checkstyle | 
https://ci-hadoop.apache.org/job/PreCommit-PHOENIX-Build/390/artifact/patchprocess/diff-checkstyle-phoenix-core.txt
 |
| whitespace | 

[jira] [Commented] (PHOENIX-6434) Secondary Indexes on PHOENIX_ROW_TIMESTAMP()

2021-04-21 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/PHOENIX-6434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17327033#comment-17327033
 ] 

ASF GitHub Bot commented on PHOENIX-6434:
-

kadirozde merged pull request #1194:
URL: https://github.com/apache/phoenix/pull/1194


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Secondary Indexes on PHOENIX_ROW_TIMESTAMP()
> 
>
> Key: PHOENIX-6434
> URL: https://issues.apache.org/jira/browse/PHOENIX-6434
> Project: Phoenix
>  Issue Type: Improvement
>Affects Versions: 5.1.0, 4.16.0
>Reporter: Kadir Ozdemir
>Priority: Major
> Attachments: PHOENIX-6434.4.x.001.patch, PHOENIX-6434.4.x.002.patch, 
> PHOENIX-6434.4.x.003.patch, PHOENIX-6434.4.x.004.patch, 
> PHOENIX-6434.master.001.patch, PHOENIX-6434.master.002.patch
>
>
> PHOENIX-5629 introduced the function PHOENIX_ROW_TIMESTAMP() that returns the 
> last modified time of a row. PHOENIX_ROW_TIMESTAMP() can be used as a 
> projection column and referred in a WHERE clause. It is desirable to have 
> indexes on row timestamps. This will result in fast time range queries. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (PHOENIX-6434) Secondary Indexes on PHOENIX_ROW_TIMESTAMP()

2021-04-21 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/PHOENIX-6434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17326989#comment-17326989
 ] 

ASF GitHub Bot commented on PHOENIX-6434:
-

stoty commented on pull request #1194:
URL: https://github.com/apache/phoenix/pull/1194#issuecomment-824413395


   :broken_heart: **-1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime | Comment |
   |::|--:|:|:|
   | +0 :ok: |  reexec  |   0m 33s |  Docker mode activated.  |
   ||| _ Prechecks _ |
   | +1 :green_heart: |  dupname  |   0m  0s |  No case conflicting files 
found.  |
   | +1 :green_heart: |  hbaseanti  |   0m  0s |  Patch does not have any 
anti-patterns.  |
   | +1 :green_heart: |  @author  |   0m  0s |  The patch does not contain any 
@author tags.  |
   | +1 :green_heart: |  test4tests  |   0m  0s |  The patch appears to include 
1 new or modified test files.  |
   ||| _ 4.x Compile Tests _ |
   | +1 :green_heart: |  mvninstall  |  14m  8s |  4.x passed  |
   | +1 :green_heart: |  compile  |   1m  2s |  4.x passed  |
   | +1 :green_heart: |  checkstyle  |   2m 50s |  4.x passed  |
   | +1 :green_heart: |  javadoc  |   0m 51s |  4.x passed  |
   | +0 :ok: |  spotbugs  |   3m 13s |  phoenix-core in 4.x has 945 extant 
spotbugs warnings.  |
   ||| _ Patch Compile Tests _ |
   | +1 :green_heart: |  mvninstall  |   5m 58s |  the patch passed  |
   | +1 :green_heart: |  compile  |   1m  5s |  the patch passed  |
   | +1 :green_heart: |  javac  |   1m  5s |  the patch passed  |
   | -1 :x: |  checkstyle  |   2m 58s |  phoenix-core: The patch generated 67 
new + 7335 unchanged - 22 fixed = 7402 total (was 7357)  |
   | -1 :x: |  whitespace  |   0m  0s |  The patch 1 line(s) with tabs.  |
   | +1 :green_heart: |  javadoc  |   0m 47s |  the patch passed  |
   | +1 :green_heart: |  spotbugs  |   3m 20s |  the patch passed  |
   ||| _ Other Tests _ |
   | +1 :green_heart: |  unit  | 137m 21s |  phoenix-core in the patch passed.  
|
   | +1 :green_heart: |  asflicense  |   0m 10s |  The patch does not generate 
ASF License warnings.  |
   |  |   | 175m 17s |   |
   
   
   | Subsystem | Report/Notes |
   |--:|:-|
   | Docker | ClientAPI=1.41 ServerAPI=1.41 base: 
https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1194/6/artifact/yetus-general-check/output/Dockerfile
 |
   | GITHUB PR | https://github.com/apache/phoenix/pull/1194 |
   | Optional Tests | dupname asflicense javac javadoc unit spotbugs hbaseanti 
checkstyle compile |
   | uname | Linux 979b16f57d88 4.15.0-112-generic #113-Ubuntu SMP Thu Jul 9 
23:41:39 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux |
   | Build tool | maven |
   | Personality | dev/phoenix-personality.sh |
   | git revision | 4.x / 049b9d8 |
   | Default Java | Private Build-1.8.0_242-8u242-b08-0ubuntu3~16.04-b08 |
   | checkstyle | 
https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1194/6/artifact/yetus-general-check/output/diff-checkstyle-phoenix-core.txt
 |
   | whitespace | 
https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1194/6/artifact/yetus-general-check/output/whitespace-tabs.txt
 |
   |  Test Results | 
https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1194/6/testReport/
 |
   | Max. process+thread count | 5900 (vs. ulimit of 3) |
   | modules | C: phoenix-core U: phoenix-core |
   | Console output | 
https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1194/6/console
 |
   | versions | git=2.7.4 maven=3.3.9 spotbugs=4.1.3 |
   | Powered by | Apache Yetus 0.12.0 https://yetus.apache.org |
   
   
   This message was automatically generated.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Secondary Indexes on PHOENIX_ROW_TIMESTAMP()
> 
>
> Key: PHOENIX-6434
> URL: https://issues.apache.org/jira/browse/PHOENIX-6434
> Project: Phoenix
>  Issue Type: Improvement
>Affects Versions: 5.1.0, 4.16.0
>Reporter: Kadir Ozdemir
>Priority: Major
> Attachments: PHOENIX-6434.4.x.001.patch, PHOENIX-6434.4.x.002.patch, 
> PHOENIX-6434.4.x.003.patch, PHOENIX-6434.4.x.004.patch, 
> PHOENIX-6434.master.001.patch
>
>
> PHOENIX-5629 introduced the function PHOENIX_ROW_TIMESTAMP() that returns the 
> last modified time of a row. PHOENIX_ROW_TIMESTAMP() can be used as a 
> projection column and referred in a WHERE clause. It is desirable to have 
> indexes on row timestamps. This will result in fast time range queries. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (PHOENIX-6434) Secondary Indexes on PHOENIX_ROW_TIMESTAMP()

2021-04-21 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/PHOENIX-6434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17326923#comment-17326923
 ] 

ASF GitHub Bot commented on PHOENIX-6434:
-

kadirozde commented on a change in pull request #1194:
URL: https://github.com/apache/phoenix/pull/1194#discussion_r617877791



##
File path: 
phoenix-core/src/it/java/org/apache/phoenix/end2end/index/GlobalIndexCheckerIT.java
##
@@ -95,7 +97,7 @@ public void beforeTest(){
 indexOptionBuilder = new StringBuilder();
 if (!encoded) {
 optionBuilder.append(" COLUMN_ENCODED_BYTES=0");
-indexOptionBuilder.append(" 
IMMUTABLE_STORAGE_SCHEME=SINGLE_CELL_ARRAY_WITH_OFFSETS, 
COLUMN_ENCODED_BYTES=2");
+//indexOptionBuilder.append(" 
IMMUTABLE_STORAGE_SCHEME=SINGLE_CELL_ARRAY_WITH_OFFSETS, 
COLUMN_ENCODED_BYTES=2");

Review comment:
   No, it was on purpose. I wanted to make sure that it works without the 
single cell format and forgot to remove it.  I will remove it.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Secondary Indexes on PHOENIX_ROW_TIMESTAMP()
> 
>
> Key: PHOENIX-6434
> URL: https://issues.apache.org/jira/browse/PHOENIX-6434
> Project: Phoenix
>  Issue Type: Improvement
>Affects Versions: 5.1.0, 4.16.0
>Reporter: Kadir Ozdemir
>Priority: Major
> Attachments: PHOENIX-6434.4.x.001.patch, PHOENIX-6434.4.x.002.patch, 
> PHOENIX-6434.4.x.003.patch, PHOENIX-6434.4.x.004.patch, 
> PHOENIX-6434.master.001.patch
>
>
> PHOENIX-5629 introduced the function PHOENIX_ROW_TIMESTAMP() that returns the 
> last modified time of a row. PHOENIX_ROW_TIMESTAMP() can be used as a 
> projection column and referred in a WHERE clause. It is desirable to have 
> indexes on row timestamps. This will result in fast time range queries. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (PHOENIX-6434) Secondary Indexes on PHOENIX_ROW_TIMESTAMP()

2021-04-21 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/PHOENIX-6434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17326919#comment-17326919
 ] 

ASF GitHub Bot commented on PHOENIX-6434:
-

kadirozde commented on a change in pull request #1194:
URL: https://github.com/apache/phoenix/pull/1194#discussion_r617877105



##
File path: 
phoenix-core/src/main/java/org/apache/phoenix/coprocessor/GlobalIndexRegionScanner.java
##
@@ -263,7 +263,19 @@ public ImmutableBytesWritable 
getLatestValue(ColumnReference ref, long ts) {
 valuePtr.set(cell.getValueArray(), cell.getValueOffset(), 
cell.getValueLength());
 return valuePtr;
 }
-
+@Override
+public KeyValue getLatestKeyValue(ColumnReference ref, long ts) {
+List cellList = put.get(ref.getFamily(), ref.getQualifier());
+if (cellList == null || cellList.isEmpty()) {
+return null;
+}
+Cell cell = cellList.get(0);
+return new KeyValue(cell.getRowArray(), cell.getRowOffset(), 
cell.getRowLength(),

Review comment:
   Casting Cell as KeyValue does not work in all cases. It triggers an 
HBase exception. 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Secondary Indexes on PHOENIX_ROW_TIMESTAMP()
> 
>
> Key: PHOENIX-6434
> URL: https://issues.apache.org/jira/browse/PHOENIX-6434
> Project: Phoenix
>  Issue Type: Improvement
>Affects Versions: 5.1.0, 4.16.0
>Reporter: Kadir Ozdemir
>Priority: Major
> Attachments: PHOENIX-6434.4.x.001.patch, PHOENIX-6434.4.x.002.patch, 
> PHOENIX-6434.4.x.003.patch, PHOENIX-6434.4.x.004.patch, 
> PHOENIX-6434.master.001.patch
>
>
> PHOENIX-5629 introduced the function PHOENIX_ROW_TIMESTAMP() that returns the 
> last modified time of a row. PHOENIX_ROW_TIMESTAMP() can be used as a 
> projection column and referred in a WHERE clause. It is desirable to have 
> indexes on row timestamps. This will result in fast time range queries. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (PHOENIX-6434) Secondary Indexes on PHOENIX_ROW_TIMESTAMP()

2021-04-21 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/PHOENIX-6434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17326897#comment-17326897
 ] 

ASF GitHub Bot commented on PHOENIX-6434:
-

lhofhansl commented on pull request #1194:
URL: https://github.com/apache/phoenix/pull/1194#issuecomment-824337031


   Still +1
   
   I applied the changes locally onto the 5.1 branch, and did a bunch of manual 
tests. Works as expected.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Secondary Indexes on PHOENIX_ROW_TIMESTAMP()
> 
>
> Key: PHOENIX-6434
> URL: https://issues.apache.org/jira/browse/PHOENIX-6434
> Project: Phoenix
>  Issue Type: Improvement
>Affects Versions: 5.1.0, 4.16.0
>Reporter: Kadir Ozdemir
>Priority: Major
> Attachments: PHOENIX-6434.4.x.001.patch, PHOENIX-6434.4.x.002.patch, 
> PHOENIX-6434.4.x.003.patch, PHOENIX-6434.4.x.004.patch, 
> PHOENIX-6434.master.001.patch
>
>
> PHOENIX-5629 introduced the function PHOENIX_ROW_TIMESTAMP() that returns the 
> last modified time of a row. PHOENIX_ROW_TIMESTAMP() can be used as a 
> projection column and referred in a WHERE clause. It is desirable to have 
> indexes on row timestamps. This will result in fast time range queries. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (PHOENIX-6434) Secondary Indexes on PHOENIX_ROW_TIMESTAMP()

2021-04-21 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/PHOENIX-6434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17326878#comment-17326878
 ] 

ASF GitHub Bot commented on PHOENIX-6434:
-

lhofhansl commented on a change in pull request #1194:
URL: https://github.com/apache/phoenix/pull/1194#discussion_r617835564



##
File path: 
phoenix-core/src/main/java/org/apache/phoenix/coprocessor/GlobalIndexRegionScanner.java
##
@@ -263,7 +263,19 @@ public ImmutableBytesWritable 
getLatestValue(ColumnReference ref, long ts) {
 valuePtr.set(cell.getValueArray(), cell.getValueOffset(), 
cell.getValueLength());
 return valuePtr;
 }
-
+@Override
+public KeyValue getLatestKeyValue(ColumnReference ref, long ts) {
+List cellList = put.get(ref.getFamily(), ref.getQualifier());
+if (cellList == null || cellList.isEmpty()) {
+return null;
+}
+Cell cell = cellList.get(0);
+return new KeyValue(cell.getRowArray(), cell.getRowOffset(), 
cell.getRowLength(),

Review comment:
   It's deprecated because we're trying to depeicate KeyValue, I think. 
Hmmm, perhaps better not to use it.
   
   Do you need a KeyValue as output, or would a Cell work as well?
   




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Secondary Indexes on PHOENIX_ROW_TIMESTAMP()
> 
>
> Key: PHOENIX-6434
> URL: https://issues.apache.org/jira/browse/PHOENIX-6434
> Project: Phoenix
>  Issue Type: Improvement
>Affects Versions: 5.1.0, 4.16.0
>Reporter: Kadir Ozdemir
>Priority: Major
> Attachments: PHOENIX-6434.4.x.001.patch, PHOENIX-6434.4.x.002.patch, 
> PHOENIX-6434.4.x.003.patch, PHOENIX-6434.4.x.004.patch, 
> PHOENIX-6434.master.001.patch
>
>
> PHOENIX-5629 introduced the function PHOENIX_ROW_TIMESTAMP() that returns the 
> last modified time of a row. PHOENIX_ROW_TIMESTAMP() can be used as a 
> projection column and referred in a WHERE clause. It is desirable to have 
> indexes on row timestamps. This will result in fast time range queries. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (PHOENIX-6434) Secondary Indexes on PHOENIX_ROW_TIMESTAMP()

2021-04-21 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/PHOENIX-6434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17326873#comment-17326873
 ] 

ASF GitHub Bot commented on PHOENIX-6434:
-

kadirozde commented on a change in pull request #1194:
URL: https://github.com/apache/phoenix/pull/1194#discussion_r617830533



##
File path: 
phoenix-core/src/main/java/org/apache/phoenix/coprocessor/GlobalIndexRegionScanner.java
##
@@ -263,7 +263,19 @@ public ImmutableBytesWritable 
getLatestValue(ColumnReference ref, long ts) {
 valuePtr.set(cell.getValueArray(), cell.getValueOffset(), 
cell.getValueLength());
 return valuePtr;
 }
-
+@Override
+public KeyValue getLatestKeyValue(ColumnReference ref, long ts) {
+List cellList = put.get(ref.getFamily(), ref.getQualifier());
+if (cellList == null || cellList.isEmpty()) {
+return null;
+}
+Cell cell = cellList.get(0);
+return new KeyValue(cell.getRowArray(), cell.getRowOffset(), 
cell.getRowLength(),

Review comment:
   It is deprecated. Should I use it?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Secondary Indexes on PHOENIX_ROW_TIMESTAMP()
> 
>
> Key: PHOENIX-6434
> URL: https://issues.apache.org/jira/browse/PHOENIX-6434
> Project: Phoenix
>  Issue Type: Improvement
>Affects Versions: 5.1.0, 4.16.0
>Reporter: Kadir Ozdemir
>Priority: Major
> Attachments: PHOENIX-6434.4.x.001.patch, PHOENIX-6434.4.x.002.patch, 
> PHOENIX-6434.4.x.003.patch, PHOENIX-6434.4.x.004.patch, 
> PHOENIX-6434.master.001.patch
>
>
> PHOENIX-5629 introduced the function PHOENIX_ROW_TIMESTAMP() that returns the 
> last modified time of a row. PHOENIX_ROW_TIMESTAMP() can be used as a 
> projection column and referred in a WHERE clause. It is desirable to have 
> indexes on row timestamps. This will result in fast time range queries. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (PHOENIX-6434) Secondary Indexes on PHOENIX_ROW_TIMESTAMP()

2021-04-21 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/PHOENIX-6434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17326859#comment-17326859
 ] 

ASF GitHub Bot commented on PHOENIX-6434:
-

lhofhansl commented on a change in pull request #1194:
URL: https://github.com/apache/phoenix/pull/1194#discussion_r617822638



##
File path: 
phoenix-core/src/main/java/org/apache/phoenix/coprocessor/GlobalIndexRegionScanner.java
##
@@ -263,7 +263,19 @@ public ImmutableBytesWritable 
getLatestValue(ColumnReference ref, long ts) {
 valuePtr.set(cell.getValueArray(), cell.getValueOffset(), 
cell.getValueLength());
 return valuePtr;
 }
-
+@Override
+public KeyValue getLatestKeyValue(ColumnReference ref, long ts) {
+List cellList = put.get(ref.getFamily(), ref.getQualifier());
+if (cellList == null || cellList.isEmpty()) {
+return null;
+}
+Cell cell = cellList.get(0);
+return new KeyValue(cell.getRowArray(), cell.getRowOffset(), 
cell.getRowLength(),

Review comment:
   return org.apache.hadoop.hbase.KeyValueUtil.ensureKeyValue(cell)?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Secondary Indexes on PHOENIX_ROW_TIMESTAMP()
> 
>
> Key: PHOENIX-6434
> URL: https://issues.apache.org/jira/browse/PHOENIX-6434
> Project: Phoenix
>  Issue Type: Improvement
>Affects Versions: 5.1.0, 4.16.0
>Reporter: Kadir Ozdemir
>Priority: Major
> Attachments: PHOENIX-6434.4.x.001.patch, PHOENIX-6434.4.x.002.patch, 
> PHOENIX-6434.4.x.003.patch, PHOENIX-6434.4.x.004.patch, 
> PHOENIX-6434.master.001.patch
>
>
> PHOENIX-5629 introduced the function PHOENIX_ROW_TIMESTAMP() that returns the 
> last modified time of a row. PHOENIX_ROW_TIMESTAMP() can be used as a 
> projection column and referred in a WHERE clause. It is desirable to have 
> indexes on row timestamps. This will result in fast time range queries. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (PHOENIX-6434) Secondary Indexes on PHOENIX_ROW_TIMESTAMP()

2021-04-21 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/PHOENIX-6434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17326857#comment-17326857
 ] 

ASF GitHub Bot commented on PHOENIX-6434:
-

lhofhansl commented on a change in pull request #1194:
URL: https://github.com/apache/phoenix/pull/1194#discussion_r617820447



##
File path: 
phoenix-core/src/it/java/org/apache/phoenix/end2end/index/GlobalIndexCheckerIT.java
##
@@ -95,7 +97,7 @@ public void beforeTest(){
 indexOptionBuilder = new StringBuilder();
 if (!encoded) {
 optionBuilder.append(" COLUMN_ENCODED_BYTES=0");
-indexOptionBuilder.append(" 
IMMUTABLE_STORAGE_SCHEME=SINGLE_CELL_ARRAY_WITH_OFFSETS, 
COLUMN_ENCODED_BYTES=2");
+//indexOptionBuilder.append(" 
IMMUTABLE_STORAGE_SCHEME=SINGLE_CELL_ARRAY_WITH_OFFSETS, 
COLUMN_ENCODED_BYTES=2");

Review comment:
   On purpose? Do you need this for the NO_INDEX parts of the tests to pass?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Secondary Indexes on PHOENIX_ROW_TIMESTAMP()
> 
>
> Key: PHOENIX-6434
> URL: https://issues.apache.org/jira/browse/PHOENIX-6434
> Project: Phoenix
>  Issue Type: Improvement
>Affects Versions: 5.1.0, 4.16.0
>Reporter: Kadir Ozdemir
>Priority: Major
> Attachments: PHOENIX-6434.4.x.001.patch, PHOENIX-6434.4.x.002.patch, 
> PHOENIX-6434.4.x.003.patch, PHOENIX-6434.4.x.004.patch, 
> PHOENIX-6434.master.001.patch
>
>
> PHOENIX-5629 introduced the function PHOENIX_ROW_TIMESTAMP() that returns the 
> last modified time of a row. PHOENIX_ROW_TIMESTAMP() can be used as a 
> projection column and referred in a WHERE clause. It is desirable to have 
> indexes on row timestamps. This will result in fast time range queries. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (PHOENIX-6434) Secondary Indexes on PHOENIX_ROW_TIMESTAMP()

2021-04-21 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/PHOENIX-6434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17326856#comment-17326856
 ] 

ASF GitHub Bot commented on PHOENIX-6434:
-

lhofhansl commented on a change in pull request #1194:
URL: https://github.com/apache/phoenix/pull/1194#discussion_r617820447



##
File path: 
phoenix-core/src/it/java/org/apache/phoenix/end2end/index/GlobalIndexCheckerIT.java
##
@@ -95,7 +97,7 @@ public void beforeTest(){
 indexOptionBuilder = new StringBuilder();
 if (!encoded) {
 optionBuilder.append(" COLUMN_ENCODED_BYTES=0");
-indexOptionBuilder.append(" 
IMMUTABLE_STORAGE_SCHEME=SINGLE_CELL_ARRAY_WITH_OFFSETS, 
COLUMN_ENCODED_BYTES=2");
+//indexOptionBuilder.append(" 
IMMUTABLE_STORAGE_SCHEME=SINGLE_CELL_ARRAY_WITH_OFFSETS, 
COLUMN_ENCODED_BYTES=2");

Review comment:
   On purpose?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Secondary Indexes on PHOENIX_ROW_TIMESTAMP()
> 
>
> Key: PHOENIX-6434
> URL: https://issues.apache.org/jira/browse/PHOENIX-6434
> Project: Phoenix
>  Issue Type: Improvement
>Affects Versions: 5.1.0, 4.16.0
>Reporter: Kadir Ozdemir
>Priority: Major
> Attachments: PHOENIX-6434.4.x.001.patch, PHOENIX-6434.4.x.002.patch, 
> PHOENIX-6434.4.x.003.patch, PHOENIX-6434.4.x.004.patch, 
> PHOENIX-6434.master.001.patch
>
>
> PHOENIX-5629 introduced the function PHOENIX_ROW_TIMESTAMP() that returns the 
> last modified time of a row. PHOENIX_ROW_TIMESTAMP() can be used as a 
> projection column and referred in a WHERE clause. It is desirable to have 
> indexes on row timestamps. This will result in fast time range queries. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (PHOENIX-6434) Secondary Indexes on PHOENIX_ROW_TIMESTAMP()

2021-04-21 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/PHOENIX-6434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17326852#comment-17326852
 ] 

ASF GitHub Bot commented on PHOENIX-6434:
-

lhofhansl commented on a change in pull request #1194:
URL: https://github.com/apache/phoenix/pull/1194#discussion_r617818582



##
File path: 
phoenix-core/src/it/java/org/apache/phoenix/end2end/index/GlobalIndexCheckerIT.java
##
@@ -167,6 +169,129 @@ public void testDelete() throws Exception {
 }
 }
 
+@Test
+public void testPhoenixRowTimestamp() throws Exception {
+try (Connection conn = DriverManager.getConnection(getUrl())) {
+String dataTableName = generateUniqueName();
+String indexTableName = generateUniqueName();
+Timestamp initial = new 
Timestamp(EnvironmentEdgeManager.currentTimeMillis() - 1);
+conn.createStatement().execute("create table " + dataTableName +
+" (id varchar(10) not null primary key, val1 varchar(10), 
val2 varchar(10), val3 varchar(10))" + tableDDLOptions);
+conn.createStatement().execute("upsert into " + dataTableName + " 
values ('a', 'ab', 'abc', 'abcd')");
+conn.commit();
+Timestamp before = new 
Timestamp(EnvironmentEdgeManager.currentTimeMillis());
+// Sleep 1ms to get a different row timestamps
+Thread.sleep(1);
+conn.createStatement().execute("upsert into " + dataTableName + " 
values ('b', 'bc', 'bcd', 'bcde')");
+conn.commit();
+Timestamp after = new 
Timestamp(EnvironmentEdgeManager.currentTimeMillis() + 1);
+conn.createStatement().execute("CREATE INDEX " + indexTableName + 
" on " +
+dataTableName + " (val1, PHOENIX_ROW_TIMESTAMP()) " + 
"include (val2, val3) " + (async ? "ASYNC" : "")+ this.indexDDLOptions);
+if (async) {
+// Run the index MR job to rebuild the index and verify that 
index is built correctly
+IndexToolIT.runIndexTool(true, false, null, dataTableName,
+indexTableName, null, 0, 
IndexTool.IndexVerifyType.AFTER);
+}
+
+String timeZoneID = Calendar.getInstance().getTimeZone().getID();
+// Write a query to get the val2 = 'bc' with a time range query
+String query = "SELECT  val1, val2, PHOENIX_ROW_TIMESTAMP() from " 
+ dataTableName + " WHERE val1 = 'bc' AND " +

Review comment:
   Nice!
   I definitely found that SELECT COUNT(DISTINCT(phoenix_row_timestamp())) FROM 
T returns the wrong results. That is due to an incorrect plan being generated, 
though, not related to this. I filed a separate jira for that.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Secondary Indexes on PHOENIX_ROW_TIMESTAMP()
> 
>
> Key: PHOENIX-6434
> URL: https://issues.apache.org/jira/browse/PHOENIX-6434
> Project: Phoenix
>  Issue Type: Improvement
>Affects Versions: 5.1.0, 4.16.0
>Reporter: Kadir Ozdemir
>Priority: Major
> Attachments: PHOENIX-6434.4.x.001.patch, PHOENIX-6434.4.x.002.patch, 
> PHOENIX-6434.4.x.003.patch, PHOENIX-6434.4.x.004.patch, 
> PHOENIX-6434.master.001.patch
>
>
> PHOENIX-5629 introduced the function PHOENIX_ROW_TIMESTAMP() that returns the 
> last modified time of a row. PHOENIX_ROW_TIMESTAMP() can be used as a 
> projection column and referred in a WHERE clause. It is desirable to have 
> indexes on row timestamps. This will result in fast time range queries. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (PHOENIX-6434) Secondary Indexes on PHOENIX_ROW_TIMESTAMP()

2021-04-21 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/PHOENIX-6434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17326721#comment-17326721
 ] 

ASF GitHub Bot commented on PHOENIX-6434:
-

kadirozde commented on a change in pull request #1194:
URL: https://github.com/apache/phoenix/pull/1194#discussion_r617720859



##
File path: 
phoenix-core/src/it/java/org/apache/phoenix/end2end/index/GlobalIndexCheckerIT.java
##
@@ -167,6 +169,129 @@ public void testDelete() throws Exception {
 }
 }
 
+@Test
+public void testPhoenixRowTimestamp() throws Exception {
+try (Connection conn = DriverManager.getConnection(getUrl())) {
+String dataTableName = generateUniqueName();
+String indexTableName = generateUniqueName();
+Timestamp initial = new 
Timestamp(EnvironmentEdgeManager.currentTimeMillis() - 1);
+conn.createStatement().execute("create table " + dataTableName +
+" (id varchar(10) not null primary key, val1 varchar(10), 
val2 varchar(10), val3 varchar(10))" + tableDDLOptions);
+conn.createStatement().execute("upsert into " + dataTableName + " 
values ('a', 'ab', 'abc', 'abcd')");
+conn.commit();
+Timestamp before = new 
Timestamp(EnvironmentEdgeManager.currentTimeMillis());
+// Sleep 1ms to get a different row timestamps
+Thread.sleep(1);
+conn.createStatement().execute("upsert into " + dataTableName + " 
values ('b', 'bc', 'bcd', 'bcde')");
+conn.commit();
+Timestamp after = new 
Timestamp(EnvironmentEdgeManager.currentTimeMillis() + 1);
+conn.createStatement().execute("CREATE INDEX " + indexTableName + 
" on " +
+dataTableName + " (val1, PHOENIX_ROW_TIMESTAMP()) " + 
"include (val2, val3) " + (async ? "ASYNC" : "")+ this.indexDDLOptions);
+if (async) {
+// Run the index MR job to rebuild the index and verify that 
index is built correctly
+IndexToolIT.runIndexTool(true, false, null, dataTableName,
+indexTableName, null, 0, 
IndexTool.IndexVerifyType.AFTER);
+}
+
+String timeZoneID = Calendar.getInstance().getTimeZone().getID();
+// Write a query to get the val2 = 'bc' with a time range query
+String query = "SELECT  val1, val2, PHOENIX_ROW_TIMESTAMP() from " 
+ dataTableName + " WHERE val1 = 'bc' AND " +

Review comment:
   I noticed that my test for /*+ NO_INDEX */  was wrong and that's why it 
failed. I/*+ NO_INDEX */  worked for me.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Secondary Indexes on PHOENIX_ROW_TIMESTAMP()
> 
>
> Key: PHOENIX-6434
> URL: https://issues.apache.org/jira/browse/PHOENIX-6434
> Project: Phoenix
>  Issue Type: Improvement
>Affects Versions: 5.1.0, 4.16.0
>Reporter: Kadir Ozdemir
>Priority: Major
> Attachments: PHOENIX-6434.4.x.001.patch, PHOENIX-6434.4.x.002.patch, 
> PHOENIX-6434.4.x.003.patch, PHOENIX-6434.4.x.004.patch, 
> PHOENIX-6434.master.001.patch
>
>
> PHOENIX-5629 introduced the function PHOENIX_ROW_TIMESTAMP() that returns the 
> last modified time of a row. PHOENIX_ROW_TIMESTAMP() can be used as a 
> projection column and referred in a WHERE clause. It is desirable to have 
> indexes on row timestamps. This will result in fast time range queries. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (PHOENIX-6434) Secondary Indexes on PHOENIX_ROW_TIMESTAMP()

2021-04-21 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/PHOENIX-6434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17326385#comment-17326385
 ] 

ASF GitHub Bot commented on PHOENIX-6434:
-

stoty commented on pull request #1194:
URL: https://github.com/apache/phoenix/pull/1194#issuecomment-823908609


   :broken_heart: **-1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime | Comment |
   |::|--:|:|:|
   | +0 :ok: |  reexec  |   1m 13s |  Docker mode activated.  |
   ||| _ Prechecks _ |
   | +1 :green_heart: |  dupname  |   0m  0s |  No case conflicting files 
found.  |
   | +1 :green_heart: |  hbaseanti  |   0m  0s |  Patch does not have any 
anti-patterns.  |
   | +1 :green_heart: |  @author  |   0m  0s |  The patch does not contain any 
@author tags.  |
   | +1 :green_heart: |  test4tests  |   0m  0s |  The patch appears to include 
1 new or modified test files.  |
   ||| _ 4.x Compile Tests _ |
   | +1 :green_heart: |  mvninstall  |  15m  4s |  4.x passed  |
   | +1 :green_heart: |  compile  |   1m  6s |  4.x passed  |
   | +1 :green_heart: |  checkstyle  |   2m 25s |  4.x passed  |
   | +1 :green_heart: |  javadoc  |   0m 48s |  4.x passed  |
   | +0 :ok: |  spotbugs  |   3m 13s |  phoenix-core in 4.x has 945 extant 
spotbugs warnings.  |
   ||| _ Patch Compile Tests _ |
   | +1 :green_heart: |  mvninstall  |   6m 54s |  the patch passed  |
   | +1 :green_heart: |  compile  |   1m  6s |  the patch passed  |
   | +1 :green_heart: |  javac  |   1m  6s |  the patch passed  |
   | -1 :x: |  checkstyle  |   2m 28s |  phoenix-core: The patch generated 97 
new + 7305 unchanged - 52 fixed = 7402 total (was 7357)  |
   | -1 :x: |  whitespace  |   0m  0s |  The patch 1 line(s) with tabs.  |
   | +1 :green_heart: |  javadoc  |   0m 49s |  the patch passed  |
   | +1 :green_heart: |  spotbugs  |   3m 27s |  the patch passed  |
   ||| _ Other Tests _ |
   | +1 :green_heart: |  unit  | 198m  3s |  phoenix-core in the patch passed.  
|
   | +1 :green_heart: |  asflicense  |   0m 10s |  The patch does not generate 
ASF License warnings.  |
   |  |   | 237m 42s |   |
   
   
   | Subsystem | Report/Notes |
   |--:|:-|
   | Docker | ClientAPI=1.41 ServerAPI=1.41 base: 
https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1194/5/artifact/yetus-general-check/output/Dockerfile
 |
   | GITHUB PR | https://github.com/apache/phoenix/pull/1194 |
   | Optional Tests | dupname asflicense javac javadoc unit spotbugs hbaseanti 
checkstyle compile |
   | uname | Linux 9198c2bf9589 4.15.0-136-generic #140-Ubuntu SMP Thu Jan 28 
05:20:47 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux |
   | Build tool | maven |
   | Personality | dev/phoenix-personality.sh |
   | git revision | 4.x / b0772eb |
   | Default Java | Private Build-1.8.0_242-8u242-b08-0ubuntu3~16.04-b08 |
   | checkstyle | 
https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1194/5/artifact/yetus-general-check/output/diff-checkstyle-phoenix-core.txt
 |
   | whitespace | 
https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1194/5/artifact/yetus-general-check/output/whitespace-tabs.txt
 |
   |  Test Results | 
https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1194/5/testReport/
 |
   | Max. process+thread count | 5492 (vs. ulimit of 3) |
   | modules | C: phoenix-core U: phoenix-core |
   | Console output | 
https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1194/5/console
 |
   | versions | git=2.7.4 maven=3.3.9 spotbugs=4.1.3 |
   | Powered by | Apache Yetus 0.12.0 https://yetus.apache.org |
   
   
   This message was automatically generated.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Secondary Indexes on PHOENIX_ROW_TIMESTAMP()
> 
>
> Key: PHOENIX-6434
> URL: https://issues.apache.org/jira/browse/PHOENIX-6434
> Project: Phoenix
>  Issue Type: Improvement
>Affects Versions: 5.1.0, 4.16.0
>Reporter: Kadir Ozdemir
>Priority: Major
> Attachments: PHOENIX-6434.4.x.001.patch, PHOENIX-6434.4.x.002.patch, 
> PHOENIX-6434.4.x.003.patch, PHOENIX-6434.4.x.004.patch, 
> PHOENIX-6434.master.001.patch
>
>
> PHOENIX-5629 introduced the function PHOENIX_ROW_TIMESTAMP() that returns the 
> last modified time of a row. PHOENIX_ROW_TIMESTAMP() can be used as a 
> projection column and referred in a WHERE clause. It is desirable to have 
> indexes on row timestamps. This will result in fast time range queries. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (PHOENIX-6434) Secondary Indexes on PHOENIX_ROW_TIMESTAMP()

2021-04-19 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/PHOENIX-6434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17325404#comment-17325404
 ] 

ASF GitHub Bot commented on PHOENIX-6434:
-

lhofhansl commented on a change in pull request #1194:
URL: https://github.com/apache/phoenix/pull/1194#discussion_r616270883



##
File path: 
phoenix-core/src/main/java/org/apache/phoenix/expression/function/PhoenixRowTimestampFunction.java
##
@@ -124,7 +127,7 @@ public boolean isStateless() {
 
 @Override
 public Determinism getDeterminism() {
-return Determinism.PER_ROW;
+return Determinism.ALWAYS;

Review comment:
   Hmm... Interesting. If you do a transaction (or query) over 1000 rows 
you would not expect that PHOENIX_ROW_TIMESTAMP() returning the same one value, 
so ALWAYS seems wrong.
   
   Doing a git blame it looks like I, myself, added PER_INVOCATION with 
PHOENIX-1516, prior to that there was only ROW, STATEMENT, and ALWAYS.
   
   I agree with you that indexes should be fine with PER_ROW and ALWAYS 
determinism.
   PER_INVOCATION should be disallowed. Not 100% sure about PER_STATEMENT, 
seems that would cause problems. It is possible that some function are 
incorrectly labeled, though, we do not seems to follow that logic correctly.
   




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Secondary Indexes on PHOENIX_ROW_TIMESTAMP()
> 
>
> Key: PHOENIX-6434
> URL: https://issues.apache.org/jira/browse/PHOENIX-6434
> Project: Phoenix
>  Issue Type: Improvement
>Affects Versions: 5.1.0, 4.16.0
>Reporter: Kadir Ozdemir
>Priority: Major
> Attachments: PHOENIX-6434.4.x.001.patch, PHOENIX-6434.4.x.002.patch, 
> PHOENIX-6434.4.x.003.patch, PHOENIX-6434.4.x.004.patch, 
> PHOENIX-6434.master.001.patch
>
>
> PHOENIX-5629 introduced the function PHOENIX_ROW_TIMESTAMP() that returns the 
> last modified time of a row. PHOENIX_ROW_TIMESTAMP() can be used as a 
> projection column and referred in a WHERE clause. It is desirable to have 
> indexes on row timestamps. This will result in fast time range queries. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (PHOENIX-6434) Secondary Indexes on PHOENIX_ROW_TIMESTAMP()

2021-04-19 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/PHOENIX-6434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17325403#comment-17325403
 ] 

ASF GitHub Bot commented on PHOENIX-6434:
-

lhofhansl commented on a change in pull request #1194:
URL: https://github.com/apache/phoenix/pull/1194#discussion_r616266445



##
File path: 
phoenix-core/src/it/java/org/apache/phoenix/end2end/index/GlobalIndexCheckerIT.java
##
@@ -167,6 +169,129 @@ public void testDelete() throws Exception {
 }
 }
 
+@Test
+public void testPhoenixRowTimestamp() throws Exception {
+try (Connection conn = DriverManager.getConnection(getUrl())) {
+String dataTableName = generateUniqueName();
+String indexTableName = generateUniqueName();
+Timestamp initial = new 
Timestamp(EnvironmentEdgeManager.currentTimeMillis() - 1);
+conn.createStatement().execute("create table " + dataTableName +
+" (id varchar(10) not null primary key, val1 varchar(10), 
val2 varchar(10), val3 varchar(10))" + tableDDLOptions);
+conn.createStatement().execute("upsert into " + dataTableName + " 
values ('a', 'ab', 'abc', 'abcd')");
+conn.commit();
+Timestamp before = new 
Timestamp(EnvironmentEdgeManager.currentTimeMillis());
+// Sleep 1ms to get a different row timestamps
+Thread.sleep(1);
+conn.createStatement().execute("upsert into " + dataTableName + " 
values ('b', 'bc', 'bcd', 'bcde')");
+conn.commit();
+Timestamp after = new 
Timestamp(EnvironmentEdgeManager.currentTimeMillis() + 1);
+conn.createStatement().execute("CREATE INDEX " + indexTableName + 
" on " +
+dataTableName + " (val1, PHOENIX_ROW_TIMESTAMP()) " + 
"include (val2, val3) " + (async ? "ASYNC" : "")+ this.indexDDLOptions);
+if (async) {
+// Run the index MR job to rebuild the index and verify that 
index is built correctly
+IndexToolIT.runIndexTool(true, false, null, dataTableName,
+indexTableName, null, 0, 
IndexTool.IndexVerifyType.AFTER);
+}
+
+String timeZoneID = Calendar.getInstance().getTimeZone().getID();
+// Write a query to get the val2 = 'bc' with a time range query
+String query = "SELECT  val1, val2, PHOENIX_ROW_TIMESTAMP() from " 
+ dataTableName + " WHERE val1 = 'bc' AND " +

Review comment:
   Yeah... I found in my tests that these fail as well. Maybe comment them 
with a jira number... Not important, though.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Secondary Indexes on PHOENIX_ROW_TIMESTAMP()
> 
>
> Key: PHOENIX-6434
> URL: https://issues.apache.org/jira/browse/PHOENIX-6434
> Project: Phoenix
>  Issue Type: Improvement
>Affects Versions: 5.1.0, 4.16.0
>Reporter: Kadir Ozdemir
>Priority: Major
> Attachments: PHOENIX-6434.4.x.001.patch, PHOENIX-6434.4.x.002.patch, 
> PHOENIX-6434.4.x.003.patch, PHOENIX-6434.4.x.004.patch, 
> PHOENIX-6434.master.001.patch
>
>
> PHOENIX-5629 introduced the function PHOENIX_ROW_TIMESTAMP() that returns the 
> last modified time of a row. PHOENIX_ROW_TIMESTAMP() can be used as a 
> projection column and referred in a WHERE clause. It is desirable to have 
> indexes on row timestamps. This will result in fast time range queries. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (PHOENIX-6434) Secondary Indexes on PHOENIX_ROW_TIMESTAMP()

2021-04-19 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/PHOENIX-6434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17325276#comment-17325276
 ] 

ASF GitHub Bot commented on PHOENIX-6434:
-

kadirozde commented on a change in pull request #1194:
URL: https://github.com/apache/phoenix/pull/1194#discussion_r616124570



##
File path: 
phoenix-core/src/main/java/org/apache/phoenix/expression/function/PhoenixRowTimestampFunction.java
##
@@ -124,7 +127,7 @@ public boolean isStateless() {
 
 @Override
 public Determinism getDeterminism() {
-return Determinism.PER_ROW;
+return Determinism.ALWAYS;

Review comment:
   There is a check in MetaDataClient#createIndex(), which does not allow 
non-deterministic expressions in index and considers that anything other than 
Determinism.ALWAYS is non-deterministic. This does not seem right. SQL Server 
agrees with me "Deterministic functions always return the same result any time 
they are called with a specific set of input values and given the same state of 
the database. Nondeterministic functions may return different results each time 
they are called with a specific set of input values even if the database state 
that they access remains the same. For example, the function AVG always returns 
the same result given the qualifications stated above, but the GETDATE 
function, which returns the current datetime value, always returns a different 
result." Maybe I need to change the create index code to allow PER_ROW 
determinism too. What do you say?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Secondary Indexes on PHOENIX_ROW_TIMESTAMP()
> 
>
> Key: PHOENIX-6434
> URL: https://issues.apache.org/jira/browse/PHOENIX-6434
> Project: Phoenix
>  Issue Type: Improvement
>Affects Versions: 5.1.0, 4.16.0
>Reporter: Kadir Ozdemir
>Priority: Major
> Attachments: PHOENIX-6434.4.x.001.patch, PHOENIX-6434.4.x.002.patch, 
> PHOENIX-6434.4.x.003.patch, PHOENIX-6434.4.x.004.patch, 
> PHOENIX-6434.master.001.patch
>
>
> PHOENIX-5629 introduced the function PHOENIX_ROW_TIMESTAMP() that returns the 
> last modified time of a row. PHOENIX_ROW_TIMESTAMP() can be used as a 
> projection column and referred in a WHERE clause. It is desirable to have 
> indexes on row timestamps. This will result in fast time range queries. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (PHOENIX-6434) Secondary Indexes on PHOENIX_ROW_TIMESTAMP()

2021-04-19 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/PHOENIX-6434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17325266#comment-17325266
 ] 

ASF GitHub Bot commented on PHOENIX-6434:
-

kadirozde commented on a change in pull request #1194:
URL: https://github.com/apache/phoenix/pull/1194#discussion_r616111060



##
File path: 
phoenix-core/src/it/java/org/apache/phoenix/end2end/index/GlobalIndexCheckerIT.java
##
@@ -167,6 +169,129 @@ public void testDelete() throws Exception {
 }
 }
 
+@Test
+public void testPhoenixRowTimestamp() throws Exception {
+try (Connection conn = DriverManager.getConnection(getUrl())) {
+String dataTableName = generateUniqueName();
+String indexTableName = generateUniqueName();
+Timestamp initial = new 
Timestamp(EnvironmentEdgeManager.currentTimeMillis() - 1);
+conn.createStatement().execute("create table " + dataTableName +
+" (id varchar(10) not null primary key, val1 varchar(10), 
val2 varchar(10), val3 varchar(10))" + tableDDLOptions);
+conn.createStatement().execute("upsert into " + dataTableName + " 
values ('a', 'ab', 'abc', 'abcd')");
+conn.commit();
+Timestamp before = new 
Timestamp(EnvironmentEdgeManager.currentTimeMillis());
+// Sleep 1ms to get a different row timestamps
+Thread.sleep(1);
+conn.createStatement().execute("upsert into " + dataTableName + " 
values ('b', 'bc', 'bcd', 'bcde')");
+conn.commit();
+Timestamp after = new 
Timestamp(EnvironmentEdgeManager.currentTimeMillis() + 1);
+conn.createStatement().execute("CREATE INDEX " + indexTableName + 
" on " +
+dataTableName + " (val1, PHOENIX_ROW_TIMESTAMP()) " + 
"include (val2, val3) " + (async ? "ASYNC" : "")+ this.indexDDLOptions);
+if (async) {
+// Run the index MR job to rebuild the index and verify that 
index is built correctly
+IndexToolIT.runIndexTool(true, false, null, dataTableName,
+indexTableName, null, 0, 
IndexTool.IndexVerifyType.AFTER);
+}
+
+String timeZoneID = Calendar.getInstance().getTimeZone().getID();
+// Write a query to get the val2 = 'bc' with a time range query
+String query = "SELECT  val1, val2, PHOENIX_ROW_TIMESTAMP() from " 
+ dataTableName + " WHERE val1 = 'bc' AND " +

Review comment:
   I attempted to add a case with /*+ NO_INDEX */  but it failed. it seems 
PHOENIX_ROW_TIMESTAMP() does not work with MultiKeyValueComparisonFilter. 
Please note this is not related to the no index hint, it is a bug in general 
for data table with or without an index. I will file a bug on this. 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Secondary Indexes on PHOENIX_ROW_TIMESTAMP()
> 
>
> Key: PHOENIX-6434
> URL: https://issues.apache.org/jira/browse/PHOENIX-6434
> Project: Phoenix
>  Issue Type: Improvement
>Affects Versions: 5.1.0, 4.16.0
>Reporter: Kadir Ozdemir
>Priority: Major
> Attachments: PHOENIX-6434.4.x.001.patch, PHOENIX-6434.4.x.002.patch, 
> PHOENIX-6434.4.x.003.patch, PHOENIX-6434.4.x.004.patch, 
> PHOENIX-6434.master.001.patch
>
>
> PHOENIX-5629 introduced the function PHOENIX_ROW_TIMESTAMP() that returns the 
> last modified time of a row. PHOENIX_ROW_TIMESTAMP() can be used as a 
> projection column and referred in a WHERE clause. It is desirable to have 
> indexes on row timestamps. This will result in fast time range queries. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (PHOENIX-6434) Secondary Indexes on PHOENIX_ROW_TIMESTAMP()

2021-04-19 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/PHOENIX-6434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17325265#comment-17325265
 ] 

ASF GitHub Bot commented on PHOENIX-6434:
-

kadirozde commented on a change in pull request #1194:
URL: https://github.com/apache/phoenix/pull/1194#discussion_r616111060



##
File path: 
phoenix-core/src/it/java/org/apache/phoenix/end2end/index/GlobalIndexCheckerIT.java
##
@@ -167,6 +169,129 @@ public void testDelete() throws Exception {
 }
 }
 
+@Test
+public void testPhoenixRowTimestamp() throws Exception {
+try (Connection conn = DriverManager.getConnection(getUrl())) {
+String dataTableName = generateUniqueName();
+String indexTableName = generateUniqueName();
+Timestamp initial = new 
Timestamp(EnvironmentEdgeManager.currentTimeMillis() - 1);
+conn.createStatement().execute("create table " + dataTableName +
+" (id varchar(10) not null primary key, val1 varchar(10), 
val2 varchar(10), val3 varchar(10))" + tableDDLOptions);
+conn.createStatement().execute("upsert into " + dataTableName + " 
values ('a', 'ab', 'abc', 'abcd')");
+conn.commit();
+Timestamp before = new 
Timestamp(EnvironmentEdgeManager.currentTimeMillis());
+// Sleep 1ms to get a different row timestamps
+Thread.sleep(1);
+conn.createStatement().execute("upsert into " + dataTableName + " 
values ('b', 'bc', 'bcd', 'bcde')");
+conn.commit();
+Timestamp after = new 
Timestamp(EnvironmentEdgeManager.currentTimeMillis() + 1);
+conn.createStatement().execute("CREATE INDEX " + indexTableName + 
" on " +
+dataTableName + " (val1, PHOENIX_ROW_TIMESTAMP()) " + 
"include (val2, val3) " + (async ? "ASYNC" : "")+ this.indexDDLOptions);
+if (async) {
+// Run the index MR job to rebuild the index and verify that 
index is built correctly
+IndexToolIT.runIndexTool(true, false, null, dataTableName,
+indexTableName, null, 0, 
IndexTool.IndexVerifyType.AFTER);
+}
+
+String timeZoneID = Calendar.getInstance().getTimeZone().getID();
+// Write a query to get the val2 = 'bc' with a time range query
+String query = "SELECT  val1, val2, PHOENIX_ROW_TIMESTAMP() from " 
+ dataTableName + " WHERE val1 = 'bc' AND " +

Review comment:
   I attempted to add a case with /*+ NO_INDEX */  but it failed. it seems 
the PHOENIX_ROW_TIMESTAMP() does not work with MultiKeyValueComparisonFilter. 
Please note this is not a just  with the no index hint, it is a bug in general 
for data table with or without an index. I will file a bug on this. 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Secondary Indexes on PHOENIX_ROW_TIMESTAMP()
> 
>
> Key: PHOENIX-6434
> URL: https://issues.apache.org/jira/browse/PHOENIX-6434
> Project: Phoenix
>  Issue Type: Improvement
>Affects Versions: 5.1.0, 4.16.0
>Reporter: Kadir Ozdemir
>Priority: Major
> Attachments: PHOENIX-6434.4.x.001.patch, PHOENIX-6434.4.x.002.patch, 
> PHOENIX-6434.4.x.003.patch, PHOENIX-6434.4.x.004.patch, 
> PHOENIX-6434.master.001.patch
>
>
> PHOENIX-5629 introduced the function PHOENIX_ROW_TIMESTAMP() that returns the 
> last modified time of a row. PHOENIX_ROW_TIMESTAMP() can be used as a 
> projection column and referred in a WHERE clause. It is desirable to have 
> indexes on row timestamps. This will result in fast time range queries. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (PHOENIX-6434) Secondary Indexes on PHOENIX_ROW_TIMESTAMP()

2021-04-19 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/PHOENIX-6434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17325259#comment-17325259
 ] 

ASF GitHub Bot commented on PHOENIX-6434:
-

kadirozde commented on a change in pull request #1194:
URL: https://github.com/apache/phoenix/pull/1194#discussion_r616098790



##
File path: 
phoenix-core/src/it/java/org/apache/phoenix/end2end/IndexExtendedIT.java
##
@@ -136,6 +136,9 @@ public void testMutableIndexWithUpdates() throws Exception {
 if (!mutable) {
 return;
 }
+if (!localIndex && useSnapshot) {

Review comment:
   No, it is not related and I will remove it




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Secondary Indexes on PHOENIX_ROW_TIMESTAMP()
> 
>
> Key: PHOENIX-6434
> URL: https://issues.apache.org/jira/browse/PHOENIX-6434
> Project: Phoenix
>  Issue Type: Improvement
>Affects Versions: 5.1.0, 4.16.0
>Reporter: Kadir Ozdemir
>Priority: Major
> Attachments: PHOENIX-6434.4.x.001.patch, PHOENIX-6434.4.x.002.patch, 
> PHOENIX-6434.4.x.003.patch, PHOENIX-6434.4.x.004.patch, 
> PHOENIX-6434.master.001.patch
>
>
> PHOENIX-5629 introduced the function PHOENIX_ROW_TIMESTAMP() that returns the 
> last modified time of a row. PHOENIX_ROW_TIMESTAMP() can be used as a 
> projection column and referred in a WHERE clause. It is desirable to have 
> indexes on row timestamps. This will result in fast time range queries. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (PHOENIX-6434) Secondary Indexes on PHOENIX_ROW_TIMESTAMP()

2021-04-16 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/PHOENIX-6434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17324078#comment-17324078
 ] 

ASF GitHub Bot commented on PHOENIX-6434:
-

lhofhansl commented on a change in pull request #1194:
URL: https://github.com/apache/phoenix/pull/1194#discussion_r615117960



##
File path: 
phoenix-core/src/it/java/org/apache/phoenix/end2end/IndexExtendedIT.java
##
@@ -136,6 +136,9 @@ public void testMutableIndexWithUpdates() throws Exception {
 if (!mutable) {
 return;
 }
+if (!localIndex && useSnapshot) {

Review comment:
   Is this an unrelated change?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Secondary Indexes on PHOENIX_ROW_TIMESTAMP()
> 
>
> Key: PHOENIX-6434
> URL: https://issues.apache.org/jira/browse/PHOENIX-6434
> Project: Phoenix
>  Issue Type: Improvement
>Affects Versions: 5.1.0, 4.16.0
>Reporter: Kadir Ozdemir
>Priority: Major
> Attachments: PHOENIX-6434.4.x.001.patch, PHOENIX-6434.4.x.002.patch, 
> PHOENIX-6434.4.x.003.patch, PHOENIX-6434.4.x.004.patch, 
> PHOENIX-6434.master.001.patch
>
>
> PHOENIX-5629 introduced the function PHOENIX_ROW_TIMESTAMP() that returns the 
> last modified time of a row. PHOENIX_ROW_TIMESTAMP() can be used as a 
> projection column and referred in a WHERE clause. It is desirable to have 
> indexes on row timestamps. This will result in fast time range queries. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (PHOENIX-6434) Secondary Indexes on PHOENIX_ROW_TIMESTAMP()

2021-04-16 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/PHOENIX-6434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17324076#comment-17324076
 ] 

ASF GitHub Bot commented on PHOENIX-6434:
-

lhofhansl commented on a change in pull request #1194:
URL: https://github.com/apache/phoenix/pull/1194#discussion_r615117058



##
File path: 
phoenix-core/src/main/java/org/apache/phoenix/expression/function/PhoenixRowTimestampFunction.java
##
@@ -124,7 +127,7 @@ public boolean isStateless() {
 
 @Override
 public Determinism getDeterminism() {
-return Determinism.PER_ROW;
+return Determinism.ALWAYS;

Review comment:
   Why is this needed? And is it correct? (The row timestamp is per row.)




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Secondary Indexes on PHOENIX_ROW_TIMESTAMP()
> 
>
> Key: PHOENIX-6434
> URL: https://issues.apache.org/jira/browse/PHOENIX-6434
> Project: Phoenix
>  Issue Type: Improvement
>Affects Versions: 5.1.0, 4.16.0
>Reporter: Kadir Ozdemir
>Priority: Major
> Attachments: PHOENIX-6434.4.x.001.patch, PHOENIX-6434.4.x.002.patch, 
> PHOENIX-6434.4.x.003.patch, PHOENIX-6434.4.x.004.patch, 
> PHOENIX-6434.master.001.patch
>
>
> PHOENIX-5629 introduced the function PHOENIX_ROW_TIMESTAMP() that returns the 
> last modified time of a row. PHOENIX_ROW_TIMESTAMP() can be used as a 
> projection column and referred in a WHERE clause. It is desirable to have 
> indexes on row timestamps. This will result in fast time range queries. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (PHOENIX-6434) Secondary Indexes on PHOENIX_ROW_TIMESTAMP()

2021-04-16 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/PHOENIX-6434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17324075#comment-17324075
 ] 

ASF GitHub Bot commented on PHOENIX-6434:
-

lhofhansl commented on a change in pull request #1194:
URL: https://github.com/apache/phoenix/pull/1194#discussion_r615116067



##
File path: 
phoenix-core/src/it/java/org/apache/phoenix/end2end/index/GlobalIndexCheckerIT.java
##
@@ -167,6 +169,129 @@ public void testDelete() throws Exception {
 }
 }
 
+@Test
+public void testPhoenixRowTimestamp() throws Exception {
+try (Connection conn = DriverManager.getConnection(getUrl())) {
+String dataTableName = generateUniqueName();
+String indexTableName = generateUniqueName();
+Timestamp initial = new 
Timestamp(EnvironmentEdgeManager.currentTimeMillis() - 1);
+conn.createStatement().execute("create table " + dataTableName +
+" (id varchar(10) not null primary key, val1 varchar(10), 
val2 varchar(10), val3 varchar(10))" + tableDDLOptions);
+conn.createStatement().execute("upsert into " + dataTableName + " 
values ('a', 'ab', 'abc', 'abcd')");
+conn.commit();
+Timestamp before = new 
Timestamp(EnvironmentEdgeManager.currentTimeMillis());
+// Sleep 1ms to get a different row timestamps
+Thread.sleep(1);
+conn.createStatement().execute("upsert into " + dataTableName + " 
values ('b', 'bc', 'bcd', 'bcde')");
+conn.commit();
+Timestamp after = new 
Timestamp(EnvironmentEdgeManager.currentTimeMillis() + 1);
+conn.createStatement().execute("CREATE INDEX " + indexTableName + 
" on " +
+dataTableName + " (val1, PHOENIX_ROW_TIMESTAMP()) " + 
"include (val2, val3) " + (async ? "ASYNC" : "")+ this.indexDDLOptions);
+if (async) {
+// Run the index MR job to rebuild the index and verify that 
index is built correctly
+IndexToolIT.runIndexTool(true, false, null, dataTableName,
+indexTableName, null, 0, 
IndexTool.IndexVerifyType.AFTER);
+}
+
+String timeZoneID = Calendar.getInstance().getTimeZone().getID();
+// Write a query to get the val2 = 'bc' with a time range query
+String query = "SELECT  val1, val2, PHOENIX_ROW_TIMESTAMP() from " 
+ dataTableName + " WHERE val1 = 'bc' AND " +

Review comment:
   Mind adding some /*+ NO_INDEX */ cases? (if they break disable them, but 
would be important to have)




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Secondary Indexes on PHOENIX_ROW_TIMESTAMP()
> 
>
> Key: PHOENIX-6434
> URL: https://issues.apache.org/jira/browse/PHOENIX-6434
> Project: Phoenix
>  Issue Type: Improvement
>Affects Versions: 5.1.0, 4.16.0
>Reporter: Kadir Ozdemir
>Priority: Major
> Attachments: PHOENIX-6434.4.x.001.patch, PHOENIX-6434.4.x.002.patch, 
> PHOENIX-6434.4.x.003.patch, PHOENIX-6434.4.x.004.patch, 
> PHOENIX-6434.master.001.patch
>
>
> PHOENIX-5629 introduced the function PHOENIX_ROW_TIMESTAMP() that returns the 
> last modified time of a row. PHOENIX_ROW_TIMESTAMP() can be used as a 
> projection column and referred in a WHERE clause. It is desirable to have 
> indexes on row timestamps. This will result in fast time range queries. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (PHOENIX-6434) Secondary Indexes on PHOENIX_ROW_TIMESTAMP()

2021-04-15 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/PHOENIX-6434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17322598#comment-17322598
 ] 

ASF GitHub Bot commented on PHOENIX-6434:
-

stoty commented on pull request #1194:
URL: https://github.com/apache/phoenix/pull/1194#issuecomment-820887632


   :broken_heart: **-1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime | Comment |
   |::|--:|:|:|
   | +0 :ok: |  reexec  |   1m 14s |  Docker mode activated.  |
   ||| _ Prechecks _ |
   | +1 :green_heart: |  dupname  |   0m  0s |  No case conflicting files 
found.  |
   | +1 :green_heart: |  hbaseanti  |   0m  0s |  Patch does not have any 
anti-patterns.  |
   | +1 :green_heart: |  @author  |   0m  0s |  The patch does not contain any 
@author tags.  |
   | +1 :green_heart: |  test4tests  |   0m  0s |  The patch appears to include 
1 new or modified test files.  |
   ||| _ 4.x Compile Tests _ |
   | +1 :green_heart: |  mvninstall  |  16m  7s |  4.x passed  |
   | +1 :green_heart: |  compile  |   1m 24s |  4.x passed  |
   | +1 :green_heart: |  checkstyle  |   2m  7s |  4.x passed  |
   | +1 :green_heart: |  javadoc  |   0m 59s |  4.x passed  |
   | +0 :ok: |  spotbugs  |   4m 16s |  phoenix-core in 4.x has 945 extant 
spotbugs warnings.  |
   ||| _ Patch Compile Tests _ |
   | +1 :green_heart: |  mvninstall  |   8m 54s |  the patch passed  |
   | +1 :green_heart: |  compile  |   1m 27s |  the patch passed  |
   | +1 :green_heart: |  javac  |   1m 27s |  the patch passed  |
   | -1 :x: |  checkstyle  |   1m 53s |  phoenix-core: The patch generated 61 
new + 4438 unchanged - 22 fixed = 4499 total (was 4460)  |
   | -1 :x: |  whitespace  |   0m  1s |  The patch 1 line(s) with tabs.  |
   | +1 :green_heart: |  javadoc  |   0m 59s |  the patch passed  |
   | +1 :green_heart: |  spotbugs  |   4m  8s |  the patch passed  |
   ||| _ Other Tests _ |
   | -1 :x: |  unit  | 223m 30s |  phoenix-core in the patch failed.  |
   | +1 :green_heart: |  asflicense  |   0m 38s |  The patch does not generate 
ASF License warnings.  |
   |  |   | 270m 25s |   |
   
   
   | Reason | Tests |
   |---:|:--|
   | Failed junit tests | phoenix.end2end.UpsertSelectIT |
   
   
   | Subsystem | Report/Notes |
   |--:|:-|
   | Docker | ClientAPI=1.41 ServerAPI=1.41 base: 
https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1194/4/artifact/yetus-general-check/output/Dockerfile
 |
   | GITHUB PR | https://github.com/apache/phoenix/pull/1194 |
   | Optional Tests | dupname asflicense javac javadoc unit spotbugs hbaseanti 
checkstyle compile |
   | uname | Linux b99d2c0d6d61 4.15.0-136-generic #140-Ubuntu SMP Thu Jan 28 
05:20:47 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux |
   | Build tool | maven |
   | Personality | dev/phoenix-personality.sh |
   | git revision | 4.x / b0772eb |
   | Default Java | Private Build-1.8.0_242-8u242-b08-0ubuntu3~16.04-b08 |
   | checkstyle | 
https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1194/4/artifact/yetus-general-check/output/diff-checkstyle-phoenix-core.txt
 |
   | whitespace | 
https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1194/4/artifact/yetus-general-check/output/whitespace-tabs.txt
 |
   | unit | 
https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1194/4/artifact/yetus-general-check/output/patch-unit-phoenix-core.txt
 |
   |  Test Results | 
https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1194/4/testReport/
 |
   | Max. process+thread count | 5126 (vs. ulimit of 3) |
   | modules | C: phoenix-core U: phoenix-core |
   | Console output | 
https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1194/4/console
 |
   | versions | git=2.7.4 maven=3.3.9 spotbugs=4.1.3 |
   | Powered by | Apache Yetus 0.12.0 https://yetus.apache.org |
   
   
   This message was automatically generated.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Secondary Indexes on PHOENIX_ROW_TIMESTAMP()
> 
>
> Key: PHOENIX-6434
> URL: https://issues.apache.org/jira/browse/PHOENIX-6434
> Project: Phoenix
>  Issue Type: Improvement
>Affects Versions: 5.1.0, 4.16.0
>Reporter: Kadir Ozdemir
>Priority: Major
> Attachments: PHOENIX-6434.4.x.001.patch, PHOENIX-6434.4.x.002.patch, 
> PHOENIX-6434.4.x.003.patch, PHOENIX-6434.4.x.004.patch, 
> PHOENIX-6434.master.001.patch
>
>
> PHOENIX-5629 introduced the function PHOENIX_ROW_TIMESTAMP() that returns the 
> last modified time of a row. 

[jira] [Commented] (PHOENIX-6434) Secondary Indexes on PHOENIX_ROW_TIMESTAMP()

2021-04-15 Thread Hadoop QA (Jira)


[ 
https://issues.apache.org/jira/browse/PHOENIX-6434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17322566#comment-17322566
 ] 

Hadoop QA commented on PHOENIX-6434:


| (x) *{color:red}-1 overall{color}* |
\\
\\
|| Vote || Subsystem || Runtime || Comment ||
| {color:blue}0{color} | {color:blue} reexec {color} | {color:blue}  1m 
46s{color} | {color:blue} Docker mode activated. {color} |
|| || || || {color:brown} Prechecks {color} ||
| {color:green}+1{color} | {color:green} dupname {color} | {color:green}  0m  
0s{color} | {color:green} No case conflicting files found. {color} |
| {color:green}+1{color} | {color:green} hbaseanti {color} | {color:green}  0m  
0s{color} | {color:green} Patch does not have any anti-patterns. {color} |
| {color:green}+1{color} | {color:green} @author {color} | {color:green}  0m  
0s{color} | {color:green} The patch does not contain any @author tags. {color} |
| {color:green}+1{color} | {color:green} test4tests {color} | {color:green}  0m 
 0s{color} | {color:green} The patch appears to include 1 new or modified test 
files. {color} |
|| || || || {color:brown} master Compile Tests {color} ||
| {color:green}+1{color} | {color:green} mvninstall {color} | {color:green} 17m 
22s{color} | {color:green} master passed {color} |
| {color:black}+0{color} | {color:black} hbaserecompile {color} | {color:black} 
24m 42s{color} | {color:black} HBase recompiled. {color} |
| {color:green}+1{color} | {color:green} compile {color} | {color:green}  1m  
5s{color} | {color:green} master passed {color} |
| {color:green}+1{color} | {color:green} checkstyle {color} | {color:green}  1m 
41s{color} | {color:green} master passed {color} |
| {color:green}+1{color} | {color:green} javadoc {color} | {color:green}  0m 
56s{color} | {color:green} master passed {color} |
| {color:blue}0{color} | {color:blue} spotbugs {color} | {color:blue}  3m 
32s{color} | {color:blue} phoenix-core in master has 960 extant spotbugs 
warnings. {color} |
|| || || || {color:brown} Patch Compile Tests {color} ||
| {color:green}+1{color} | {color:green} mvninstall {color} | {color:green} 10m 
15s{color} | {color:green} the patch passed {color} |
| {color:black}+0{color} | {color:black} hbaserecompile {color} | {color:black} 
21m 13s{color} | {color:black} HBase recompiled. {color} |
| {color:green}+1{color} | {color:green} compile {color} | {color:green}  1m  
5s{color} | {color:green} the patch passed {color} |
| {color:green}+1{color} | {color:green} javac {color} | {color:green}  1m  
5s{color} | {color:green} the patch passed {color} |
| {color:red}-1{color} | {color:red} checkstyle {color} | {color:red}  1m 
42s{color} | {color:red} phoenix-core: The patch generated 94 new + 4533 
unchanged - 49 fixed = 4627 total (was 4582) {color} |
| {color:red}-1{color} | {color:red} whitespace {color} | {color:red}  0m  
0s{color} | {color:red} The patch 1 line(s) with tabs. {color} |
| {color:green}+1{color} | {color:green} javadoc {color} | {color:green}  0m 
51s{color} | {color:green} the patch passed {color} |
| {color:green}+1{color} | {color:green} spotbugs {color} | {color:green}  3m 
33s{color} | {color:green} the patch passed {color} |
|| || || || {color:brown} Other Tests {color} ||
| {color:red}-1{color} | {color:red} unit {color} | {color:red}117m 11s{color} 
| {color:red} phoenix-core in the patch failed. {color} |
| {color:green}+1{color} | {color:green} asflicense {color} | {color:green}  0m 
33s{color} | {color:green} The patch does not generate ASF License warnings. 
{color} |
| {color:black}{color} | {color:black} {color} | {color:black}176m 53s{color} | 
{color:black} {color} |
\\
\\
|| Reason || Tests ||
| Failed junit tests | phoenix.schema.stats.NamespaceDisabledStatsCollectorIT |
|   | phoenix.schema.stats.NamespaceEnabledStatsCollectorIT |
|   | phoenix.schema.stats.TxStatsCollectorIT |
|   | phoenix.schema.stats.NonTxStatsCollectorIT |
\\
\\
|| Subsystem || Report/Notes ||
| Docker | ClientAPI=1.41 ServerAPI=1.41 base: 
https://ci-hadoop.apache.org/job/PreCommit-PHOENIX-Build/389/artifact/patchprocess/Dockerfile
 |
| JIRA Issue | PHOENIX-6434 |
| JIRA Patch URL | 
https://issues.apache.org/jira/secure/attachment/13023944/PHOENIX-6434.master.001.patch
 |
| Optional Tests | dupname asflicense javac javadoc unit spotbugs hbaserebuild 
hbaseanti checkstyle compile |
| uname | Linux 0ac30b8b98c6 4.15.0-101-generic #102-Ubuntu SMP Mon May 11 
10:07:26 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux |
| Build tool | maven |
| Personality | dev/phoenix-personality.sh |
| git revision | master / 84d317c |
| Default Java | Private Build-1.8.0_242-8u242-b08-0ubuntu3~16.04-b08 |
| checkstyle | 
https://ci-hadoop.apache.org/job/PreCommit-PHOENIX-Build/389/artifact/patchprocess/diff-checkstyle-phoenix-core.txt
 |
| whitespace | 
https://ci-hadoop.apache.org/job/PreCommit-PHOENIX-Build/389/artifact/patchprocess/whitespace-tabs.txt
 |
| unit | 

[jira] [Commented] (PHOENIX-6434) Secondary Indexes on PHOENIX_ROW_TIMESTAMP()

2021-04-15 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/PHOENIX-6434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17322518#comment-17322518
 ] 

ASF GitHub Bot commented on PHOENIX-6434:
-

stoty commented on pull request #1194:
URL: https://github.com/apache/phoenix/pull/1194#issuecomment-820767314


   :broken_heart: **-1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime | Comment |
   |::|--:|:|:|
   | +0 :ok: |  reexec  |   5m 40s |  Docker mode activated.  |
   ||| _ Prechecks _ |
   | +1 :green_heart: |  dupname  |   0m  0s |  No case conflicting files 
found.  |
   | +1 :green_heart: |  hbaseanti  |   0m  0s |  Patch does not have any 
anti-patterns.  |
   | +1 :green_heart: |  @author  |   0m  0s |  The patch does not contain any 
@author tags.  |
   | +1 :green_heart: |  test4tests  |   0m  0s |  The patch appears to include 
1 new or modified test files.  |
   ||| _ 4.x Compile Tests _ |
   | +1 :green_heart: |  mvninstall  |  13m 57s |  4.x passed  |
   | +1 :green_heart: |  compile  |   1m  2s |  4.x passed  |
   | +1 :green_heart: |  checkstyle  |   2m 21s |  4.x passed  |
   | +1 :green_heart: |  javadoc  |   0m 46s |  4.x passed  |
   | +0 :ok: |  spotbugs  |   3m  1s |  phoenix-core in 4.x has 945 extant 
spotbugs warnings.  |
   ||| _ Patch Compile Tests _ |
   | +1 :green_heart: |  mvninstall  |   5m 45s |  the patch passed  |
   | +1 :green_heart: |  compile  |   1m  0s |  the patch passed  |
   | +1 :green_heart: |  javac  |   1m  0s |  the patch passed  |
   | -1 :x: |  checkstyle  |   2m 24s |  phoenix-core: The patch generated 90 
new + 4515 unchanged - 50 fixed = 4605 total (was 4565)  |
   | -1 :x: |  whitespace  |   0m  0s |  The patch 1 line(s) with tabs.  |
   | +1 :green_heart: |  javadoc  |   0m 44s |  the patch passed  |
   | -1 :x: |  spotbugs  |   3m 12s |  phoenix-core generated 2 new + 945 
unchanged - 0 fixed = 947 total (was 945)  |
   ||| _ Other Tests _ |
   | -1 :x: |  unit  | 135m 24s |  phoenix-core in the patch failed.  |
   | +1 :green_heart: |  asflicense  |   0m 50s |  The patch does not generate 
ASF License warnings.  |
   |  |   | 179m  4s |   |
   
   
   | Reason | Tests |
   |---:|:--|
   | FindBugs | module:phoenix-core |
   |  |  Invocation of toString on cf in 
org.apache.phoenix.index.IndexMaintainer$5.addDataColInfo(PTable, Expression)  
At IndexMaintainer.java:in 
org.apache.phoenix.index.IndexMaintainer$5.addDataColInfo(PTable, Expression)  
At IndexMaintainer.java:[line 595] |
   |  |  Invocation of toString on cq in 
org.apache.phoenix.index.IndexMaintainer$5.addDataColInfo(PTable, Expression)  
At IndexMaintainer.java:in 
org.apache.phoenix.index.IndexMaintainer$5.addDataColInfo(PTable, Expression)  
At IndexMaintainer.java:[line 595] |
   | Failed junit tests | phoenix.schema.stats.TxStatsCollectorIT |
   |   | phoenix.schema.stats.NonTxStatsCollectorIT |
   |   | phoenix.schema.stats.NamespaceEnabledStatsCollectorIT |
   |   | phoenix.schema.stats.NamespaceDisabledStatsCollectorIT |
   
   
   | Subsystem | Report/Notes |
   |--:|:-|
   | Docker | ClientAPI=1.41 ServerAPI=1.41 base: 
https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1194/3/artifact/yetus-general-check/output/Dockerfile
 |
   | GITHUB PR | https://github.com/apache/phoenix/pull/1194 |
   | Optional Tests | dupname asflicense javac javadoc unit spotbugs hbaseanti 
checkstyle compile |
   | uname | Linux b24ec13d9702 4.15.0-136-generic #140-Ubuntu SMP Thu Jan 28 
05:20:47 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux |
   | Build tool | maven |
   | Personality | dev/phoenix-personality.sh |
   | git revision | 4.x / b0772eb |
   | Default Java | Private Build-1.8.0_242-8u242-b08-0ubuntu3~16.04-b08 |
   | checkstyle | 
https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1194/3/artifact/yetus-general-check/output/diff-checkstyle-phoenix-core.txt
 |
   | whitespace | 
https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1194/3/artifact/yetus-general-check/output/whitespace-tabs.txt
 |
   | spotbugs | 
https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1194/3/artifact/yetus-general-check/output/new-spotbugs-phoenix-core.html
 |
   | unit | 
https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1194/3/artifact/yetus-general-check/output/patch-unit-phoenix-core.txt
 |
   |  Test Results | 
https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1194/3/testReport/
 |
   | Max. process+thread count | 5570 (vs. ulimit of 3) |
   | modules | C: phoenix-core U: phoenix-core |
   | Console output | 
https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1194/3/console
 |
   | versions | git=2.7.4 maven=3.3.9 spotbugs=4.1.3 |
   | Powered by | Apache Yetus 0.12.0 

[jira] [Commented] (PHOENIX-6434) Secondary Indexes on PHOENIX_ROW_TIMESTAMP()

2021-04-14 Thread Lars Hofhansl (Jira)


[ 
https://issues.apache.org/jira/browse/PHOENIX-6434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17321841#comment-17321841
 ] 

Lars Hofhansl commented on PHOENIX-6434:


See PHOENIX-6445 (back to vacation now)

> Secondary Indexes on PHOENIX_ROW_TIMESTAMP()
> 
>
> Key: PHOENIX-6434
> URL: https://issues.apache.org/jira/browse/PHOENIX-6434
> Project: Phoenix
>  Issue Type: Improvement
>Affects Versions: 5.1.0, 4.16.0
>Reporter: Kadir Ozdemir
>Priority: Major
> Attachments: PHOENIX-6434.4.x.001.patch, PHOENIX-6434.4.x.002.patch, 
> PHOENIX-6434.4.x.003.patch, PHOENIX-6434.4.x.004.patch
>
>
> PHOENIX-5629 introduced the function PHOENIX_ROW_TIMESTAMP() that returns the 
> last modified time of a row. PHOENIX_ROW_TIMESTAMP() can be used as a 
> projection column and referred in a WHERE clause. It is desirable to have 
> indexes on row timestamps. This will result in fast time range queries. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (PHOENIX-6434) Secondary Indexes on PHOENIX_ROW_TIMESTAMP()

2021-04-14 Thread Lars Hofhansl (Jira)


[ 
https://issues.apache.org/jira/browse/PHOENIX-6434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17321836#comment-17321836
 ] 

Lars Hofhansl commented on PHOENIX-6434:


Thanks [~kadir]

More problems:
{code:java}
 > select count(distinct(phoenix_row_timestamp())) from test; 
++
| DISTINCT_COUNT(" PHOENIX_ROW_TIMESTAMP()") |
++
| 234466 |
++
1 row selected (3.374 seconds)

> select /*+ NO_INDEX */ count(distinct(phoenix_row_timestamp())) from test;
+---+
| DISTINCT_COUNT(PHOENIX_ROW_TIMESTAMP(X.)) |
+---+
| 26638668  |
+---+
1 row selected (11.65 seconds)

{code}
 

Looks like the value with from the index is actually the correct one. Phoenix 
generates an incorrect plan without the index. I found other weird things. For 
example Phoenix will create an incorrect plan for (the final count is 
completely missing from the plan)
{code:java}
select count(*) from (select 1 from test group by phoenix_row_timestamp()){code}
(I tried this to check whether it would produce a different number from the 
count(distinct).

And the following should not be a valid query, but it actually return v1 from 
each row
{code:java}
select v1 from test group by phoenix_row_timestamp(){code}
Anyway... These are all unrelated to this PR, and some not even related to 
phoenix_row_timestamp(). I'm on vacation that's why I did not look at the first 
issue and won't look at this for a bit.

 

> Secondary Indexes on PHOENIX_ROW_TIMESTAMP()
> 
>
> Key: PHOENIX-6434
> URL: https://issues.apache.org/jira/browse/PHOENIX-6434
> Project: Phoenix
>  Issue Type: Improvement
>Affects Versions: 5.1.0, 4.16.0
>Reporter: Kadir Ozdemir
>Priority: Major
> Attachments: PHOENIX-6434.4.x.001.patch, PHOENIX-6434.4.x.002.patch, 
> PHOENIX-6434.4.x.003.patch, PHOENIX-6434.4.x.004.patch
>
>
> PHOENIX-5629 introduced the function PHOENIX_ROW_TIMESTAMP() that returns the 
> last modified time of a row. PHOENIX_ROW_TIMESTAMP() can be used as a 
> projection column and referred in a WHERE clause. It is desirable to have 
> indexes on row timestamps. This will result in fast time range queries. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (PHOENIX-6434) Secondary Indexes on PHOENIX_ROW_TIMESTAMP()

2021-04-14 Thread Hadoop QA (Jira)


[ 
https://issues.apache.org/jira/browse/PHOENIX-6434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17320744#comment-17320744
 ] 

Hadoop QA commented on PHOENIX-6434:


| (x) *{color:red}-1 overall{color}* |
\\
\\
|| Vote || Subsystem || Runtime || Comment ||
| {color:blue}0{color} | {color:blue} reexec {color} | {color:blue}  1m 
41s{color} | {color:blue} Docker mode activated. {color} |
|| || || || {color:brown} Prechecks {color} ||
| {color:green}+1{color} | {color:green} dupname {color} | {color:green}  0m  
0s{color} | {color:green} No case conflicting files found. {color} |
| {color:green}+1{color} | {color:green} hbaseanti {color} | {color:green}  0m  
0s{color} | {color:green} Patch does not have any anti-patterns. {color} |
| {color:green}+1{color} | {color:green} @author {color} | {color:green}  0m  
0s{color} | {color:green} The patch does not contain any @author tags. {color} |
| {color:green}+1{color} | {color:green} test4tests {color} | {color:green}  0m 
 0s{color} | {color:green} The patch appears to include 1 new or modified test 
files. {color} |
|| || || || {color:brown} 4.x Compile Tests {color} ||
| {color:green}+1{color} | {color:green} mvninstall {color} | {color:green}  7m 
28s{color} | {color:green} 4.x passed {color} |
| {color:green}+1{color} | {color:green} compile {color} | {color:green}  1m  
3s{color} | {color:green} 4.x passed {color} |
| {color:green}+1{color} | {color:green} checkstyle {color} | {color:green}  1m 
39s{color} | {color:green} 4.x passed {color} |
| {color:green}+1{color} | {color:green} javadoc {color} | {color:green}  0m 
46s{color} | {color:green} 4.x passed {color} |
| {color:blue}0{color} | {color:blue} spotbugs {color} | {color:blue}  3m 
10s{color} | {color:blue} phoenix-core in 4.x has 945 extant spotbugs warnings. 
{color} |
|| || || || {color:brown} Patch Compile Tests {color} ||
| {color:green}+1{color} | {color:green} mvninstall {color} | {color:green}  6m 
38s{color} | {color:green} the patch passed {color} |
| {color:green}+1{color} | {color:green} compile {color} | {color:green}  1m  
4s{color} | {color:green} the patch passed {color} |
| {color:green}+1{color} | {color:green} javac {color} | {color:green}  1m  
4s{color} | {color:green} the patch passed {color} |
| {color:red}-1{color} | {color:red} checkstyle {color} | {color:red}  1m 
39s{color} | {color:red} phoenix-core: The patch generated 53 new + 4450 
unchanged - 12 fixed = 4503 total (was 4462) {color} |
| {color:red}-1{color} | {color:red} whitespace {color} | {color:red}  0m  
0s{color} | {color:red} The patch 1 line(s) with tabs. {color} |
| {color:green}+1{color} | {color:green} javadoc {color} | {color:green}  0m 
47s{color} | {color:green} the patch passed {color} |
| {color:red}-1{color} | {color:red} spotbugs {color} | {color:red}  3m 
28s{color} | {color:red} phoenix-core generated 2 new + 945 unchanged - 0 fixed 
= 947 total (was 945) {color} |
|| || || || {color:brown} Other Tests {color} ||
| {color:red}-1{color} | {color:red} unit {color} | {color:red}241m 57s{color} 
| {color:red} phoenix-core in the patch failed. {color} |
| {color:green}+1{color} | {color:green} asflicense {color} | {color:green}  0m 
48s{color} | {color:green} The patch does not generate ASF License warnings. 
{color} |
| {color:black}{color} | {color:black} {color} | {color:black}273m  5s{color} | 
{color:black} {color} |
\\
\\
|| Reason || Tests ||
| FindBugs | module:phoenix-core |
|  |  Invocation of toString on cf in 
org.apache.phoenix.index.IndexMaintainer$5.addDataColInfo(PTable, Expression)  
At IndexMaintainer.java:in 
org.apache.phoenix.index.IndexMaintainer$5.addDataColInfo(PTable, Expression)  
At IndexMaintainer.java:[line 595] |
|  |  Invocation of toString on cq in 
org.apache.phoenix.index.IndexMaintainer$5.addDataColInfo(PTable, Expression)  
At IndexMaintainer.java:in 
org.apache.phoenix.index.IndexMaintainer$5.addDataColInfo(PTable, Expression)  
At IndexMaintainer.java:[line 595] |
| Failed junit tests | phoenix.end2end.QueryDatabaseMetaDataIT |
|   | phoenix.end2end.NativeHBaseTypesIT |
|   | phoenix.end2end.index.ImmutableIndexIT |
|   | phoenix.end2end.MultiCfQueryExecIT |
|   | phoenix.tx.FlappingTransactionIT |
|   | phoenix.end2end.AggregateIT |
|   | phoenix.end2end.ColumnProjectionOptimizationIT |
\\
\\
|| Subsystem || Report/Notes ||
| Docker | ClientAPI=1.41 ServerAPI=1.41 base: 
https://ci-hadoop.apache.org/job/PreCommit-PHOENIX-Build/388/artifact/patchprocess/Dockerfile
 |
| JIRA Issue | PHOENIX-6434 |
| JIRA Patch URL | 
https://issues.apache.org/jira/secure/attachment/13023815/PHOENIX-6434.4.x.004.patch
 |
| Optional Tests | dupname asflicense javac javadoc unit spotbugs hbaseanti 
checkstyle compile |
| uname | Linux c35636b558dc 4.15.0-101-generic #102-Ubuntu SMP Mon May 11 
10:07:26 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux |
| Build tool | maven |
| Personality | dev/phoenix-personality.sh |
| git 

[jira] [Commented] (PHOENIX-6434) Secondary Indexes on PHOENIX_ROW_TIMESTAMP()

2021-04-13 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/PHOENIX-6434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17320715#comment-17320715
 ] 

ASF GitHub Bot commented on PHOENIX-6434:
-

stoty commented on pull request #1194:
URL: https://github.com/apache/phoenix/pull/1194#issuecomment-819250166


   :broken_heart: **-1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime | Comment |
   |::|--:|:|:|
   | +0 :ok: |  reexec  |   1m 28s |  Docker mode activated.  |
   ||| _ Prechecks _ |
   | +1 :green_heart: |  dupname  |   0m  1s |  No case conflicting files 
found.  |
   | +1 :green_heart: |  hbaseanti  |   0m  0s |  Patch does not have any 
anti-patterns.  |
   | +1 :green_heart: |  @author  |   0m  0s |  The patch does not contain any 
@author tags.  |
   | +1 :green_heart: |  test4tests  |   0m  0s |  The patch appears to include 
1 new or modified test files.  |
   ||| _ 4.x Compile Tests _ |
   | +1 :green_heart: |  mvninstall  |  15m 33s |  4.x passed  |
   | +1 :green_heart: |  compile  |   1m 15s |  4.x passed  |
   | +1 :green_heart: |  checkstyle  |   1m 54s |  4.x passed  |
   | +1 :green_heart: |  javadoc  |   0m 56s |  4.x passed  |
   | +0 :ok: |  spotbugs  |   3m 43s |  phoenix-core in 4.x has 945 extant 
spotbugs warnings.  |
   ||| _ Patch Compile Tests _ |
   | +1 :green_heart: |  mvninstall  |   8m  6s |  the patch passed  |
   | +1 :green_heart: |  compile  |   1m 21s |  the patch passed  |
   | +1 :green_heart: |  javac  |   1m 21s |  the patch passed  |
   | -1 :x: |  checkstyle  |   2m  1s |  phoenix-core: The patch generated 53 
new + 4448 unchanged - 12 fixed = 4501 total (was 4460)  |
   | -1 :x: |  whitespace  |   0m  0s |  The patch 1 line(s) with tabs.  |
   | +1 :green_heart: |  javadoc  |   1m  2s |  the patch passed  |
   | -1 :x: |  spotbugs  |   4m  8s |  phoenix-core generated 2 new + 945 
unchanged - 0 fixed = 947 total (was 945)  |
   ||| _ Other Tests _ |
   | -1 :x: |  unit  | 207m 28s |  phoenix-core in the patch failed.  |
   | +1 :green_heart: |  asflicense  |   0m 39s |  The patch does not generate 
ASF License warnings.  |
   |  |   | 252m 23s |   |
   
   
   | Reason | Tests |
   |---:|:--|
   | FindBugs | module:phoenix-core |
   |  |  Invocation of toString on cf in 
org.apache.phoenix.index.IndexMaintainer$5.addDataColInfo(PTable, Expression)  
At IndexMaintainer.java:in 
org.apache.phoenix.index.IndexMaintainer$5.addDataColInfo(PTable, Expression)  
At IndexMaintainer.java:[line 595] |
   |  |  Invocation of toString on cq in 
org.apache.phoenix.index.IndexMaintainer$5.addDataColInfo(PTable, Expression)  
At IndexMaintainer.java:in 
org.apache.phoenix.index.IndexMaintainer$5.addDataColInfo(PTable, Expression)  
At IndexMaintainer.java:[line 595] |
   | Failed junit tests | phoenix.end2end.ColumnProjectionOptimizationIT |
   |   | phoenix.end2end.NativeHBaseTypesIT |
   |   | phoenix.end2end.QueryDatabaseMetaDataIT |
   |   | phoenix.end2end.AggregateIT |
   |   | phoenix.end2end.index.ImmutableIndexIT |
   |   | phoenix.tx.FlappingTransactionIT |
   |   | phoenix.end2end.MultiCfQueryExecIT |
   
   
   | Subsystem | Report/Notes |
   |--:|:-|
   | Docker | ClientAPI=1.41 ServerAPI=1.41 base: 
https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1194/2/artifact/yetus-general-check/output/Dockerfile
 |
   | GITHUB PR | https://github.com/apache/phoenix/pull/1194 |
   | Optional Tests | dupname asflicense javac javadoc unit spotbugs hbaseanti 
checkstyle compile |
   | uname | Linux 6041841b9b23 4.15.0-136-generic #140-Ubuntu SMP Thu Jan 28 
05:20:47 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux |
   | Build tool | maven |
   | Personality | dev/phoenix-personality.sh |
   | git revision | 4.x / b0772eb |
   | Default Java | Private Build-1.8.0_242-8u242-b08-0ubuntu3~16.04-b08 |
   | checkstyle | 
https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1194/2/artifact/yetus-general-check/output/diff-checkstyle-phoenix-core.txt
 |
   | whitespace | 
https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1194/2/artifact/yetus-general-check/output/whitespace-tabs.txt
 |
   | spotbugs | 
https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1194/2/artifact/yetus-general-check/output/new-spotbugs-phoenix-core.html
 |
   | unit | 
https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1194/2/artifact/yetus-general-check/output/patch-unit-phoenix-core.txt
 |
   |  Test Results | 
https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1194/2/testReport/
 |
   | Max. process+thread count | 4829 (vs. ulimit of 3) |
   | modules | C: phoenix-core U: phoenix-core |
   | Console output | 
https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1194/2/console
 |
   | versions 

[jira] [Commented] (PHOENIX-6434) Secondary Indexes on PHOENIX_ROW_TIMESTAMP()

2021-04-13 Thread Kadir Ozdemir (Jira)


[ 
https://issues.apache.org/jira/browse/PHOENIX-6434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17320554#comment-17320554
 ] 

Kadir Ozdemir commented on PHOENIX-6434:


[~larsh], the bug you have found with phoenix_row_timestamp() happens when the 
where clause includes phoenix_row_timestamp() and the projection includes just 
the wildcard *. The root cause of the bug is that PhoenixRowTimestampParseNode 
adds the empty column to the scan (using Scan#addColumn()). However, when the 
projection of a select statement includes the wildcard, Phoenix does not add 
any columns to scans, which results in getting all columns back from HBase. 
However, when PhoenixRowTimestampParseNode adds the empty column the scan, the 
scan returns only the empty column in this case, and this why your test got 
null value for the other columns. I will fix this in the next version of the 
PR. Thanks for finding this issue. 

> Secondary Indexes on PHOENIX_ROW_TIMESTAMP()
> 
>
> Key: PHOENIX-6434
> URL: https://issues.apache.org/jira/browse/PHOENIX-6434
> Project: Phoenix
>  Issue Type: Improvement
>Affects Versions: 5.1.0, 4.16.0
>Reporter: Kadir Ozdemir
>Priority: Major
> Attachments: PHOENIX-6434.4.x.001.patch, PHOENIX-6434.4.x.002.patch, 
> PHOENIX-6434.4.x.003.patch
>
>
> PHOENIX-5629 introduced the function PHOENIX_ROW_TIMESTAMP() that returns the 
> last modified time of a row. PHOENIX_ROW_TIMESTAMP() can be used as a 
> projection column and referred in a WHERE clause. It is desirable to have 
> indexes on row timestamps. This will result in fast time range queries. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (PHOENIX-6434) Secondary Indexes on PHOENIX_ROW_TIMESTAMP()

2021-04-12 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/PHOENIX-6434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17319765#comment-17319765
 ] 

ASF GitHub Bot commented on PHOENIX-6434:
-

stoty commented on pull request #1194:
URL: https://github.com/apache/phoenix/pull/1194#issuecomment-818289376


   :broken_heart: **-1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime | Comment |
   |::|--:|:|:|
   | +0 :ok: |  reexec  |   6m 47s |  Docker mode activated.  |
   ||| _ Prechecks _ |
   | +1 :green_heart: |  dupname  |   0m  1s |  No case conflicting files 
found.  |
   | +1 :green_heart: |  hbaseanti  |   0m  0s |  Patch does not have any 
anti-patterns.  |
   | +1 :green_heart: |  @author  |   0m  0s |  The patch does not contain any 
@author tags.  |
   | +1 :green_heart: |  test4tests  |   0m  0s |  The patch appears to include 
1 new or modified test files.  |
   ||| _ 4.x Compile Tests _ |
   | +1 :green_heart: |  mvninstall  |  15m 13s |  4.x passed  |
   | +1 :green_heart: |  compile  |   1m 34s |  4.x passed  |
   | +1 :green_heart: |  checkstyle  |   1m 50s |  4.x passed  |
   | +1 :green_heart: |  javadoc  |   0m 55s |  4.x passed  |
   | +0 :ok: |  spotbugs  |   3m 51s |  phoenix-core in 4.x has 945 extant 
spotbugs warnings.  |
   ||| _ Patch Compile Tests _ |
   | +1 :green_heart: |  mvninstall  |   8m  3s |  the patch passed  |
   | +1 :green_heart: |  compile  |   1m 17s |  the patch passed  |
   | +1 :green_heart: |  javac  |   1m 17s |  the patch passed  |
   | -1 :x: |  checkstyle  |   1m 53s |  phoenix-core: The patch generated 86 
new + 4405 unchanged - 39 fixed = 4491 total (was )  |
   | -1 :x: |  whitespace  |   0m  0s |  The patch 1 line(s) with tabs.  |
   | +1 :green_heart: |  javadoc  |   0m 56s |  the patch passed  |
   | -1 :x: |  spotbugs  |   4m  5s |  phoenix-core generated 2 new + 945 
unchanged - 0 fixed = 947 total (was 945)  |
   ||| _ Other Tests _ |
   | -1 :x: |  unit  | 264m 29s |  phoenix-core in the patch failed.  |
   | +1 :green_heart: |  asflicense  |   0m 40s |  The patch does not generate 
ASF License warnings.  |
   |  |   | 314m 29s |   |
   
   
   | Reason | Tests |
   |---:|:--|
   | FindBugs | module:phoenix-core |
   |  |  Possible null pointer dereference of dataColumn in 
org.apache.phoenix.index.IndexMaintainer$5.addDataColInfo(PTable, Expression)  
Dereferenced at IndexMaintainer.java:dataColumn in 
org.apache.phoenix.index.IndexMaintainer$5.addDataColInfo(PTable, Expression)  
Dereferenced at IndexMaintainer.java:[line 594] |
   |  |  Redundant nullcheck of value which is known to be null in 
org.apache.phoenix.schema.tuple.ValueGetterTuple.getValue(byte[], byte[])  
Redundant null check at ValueGetterTuple.java:is known to be null in 
org.apache.phoenix.schema.tuple.ValueGetterTuple.getValue(byte[], byte[])  
Redundant null check at ValueGetterTuple.java:[line 73] |
   | Failed junit tests | phoenix.tx.ParameterizedTransactionIT |
   |   | phoenix.end2end.CsvBulkLoadToolIT |
   |   | phoenix.util.IndexScrutinyIT |
   |   | phoenix.tx.TransactionIT |
   |   | phoenix.end2end.index.PartialIndexRebuilderIT |
   
   
   | Subsystem | Report/Notes |
   |--:|:-|
   | Docker | ClientAPI=1.41 ServerAPI=1.41 base: 
https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1194/1/artifact/yetus-general-check/output/Dockerfile
 |
   | GITHUB PR | https://github.com/apache/phoenix/pull/1194 |
   | Optional Tests | dupname asflicense javac javadoc unit spotbugs hbaseanti 
checkstyle compile |
   | uname | Linux 946865c23673 4.15.0-136-generic #140-Ubuntu SMP Thu Jan 28 
05:20:47 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux |
   | Build tool | maven |
   | Personality | dev/phoenix-personality.sh |
   | git revision | 4.x / 33f2463 |
   | Default Java | Private Build-1.8.0_242-8u242-b08-0ubuntu3~16.04-b08 |
   | checkstyle | 
https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1194/1/artifact/yetus-general-check/output/diff-checkstyle-phoenix-core.txt
 |
   | whitespace | 
https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1194/1/artifact/yetus-general-check/output/whitespace-tabs.txt
 |
   | spotbugs | 
https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1194/1/artifact/yetus-general-check/output/new-spotbugs-phoenix-core.html
 |
   | unit | 
https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1194/1/artifact/yetus-general-check/output/patch-unit-phoenix-core.txt
 |
   |  Test Results | 
https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1194/1/testReport/
 |
   | Max. process+thread count | 4765 (vs. ulimit of 3) |
   | modules | C: phoenix-core U: phoenix-core |
   | Console output | 

[jira] [Commented] (PHOENIX-6434) Secondary Indexes on PHOENIX_ROW_TIMESTAMP()

2021-04-12 Thread Lars Hofhansl (Jira)


[ 
https://issues.apache.org/jira/browse/PHOENIX-6434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17319684#comment-17319684
 ] 

Lars Hofhansl commented on PHOENIX-6434:


So before we can use PHOENIX_ROW_TIMESTAMP for timed retrieval it seems we have 
some bugs to fix (this is with Phoenix 5.1)

> Secondary Indexes on PHOENIX_ROW_TIMESTAMP()
> 
>
> Key: PHOENIX-6434
> URL: https://issues.apache.org/jira/browse/PHOENIX-6434
> Project: Phoenix
>  Issue Type: Improvement
>Affects Versions: 5.1.0, 4.16.0
>Reporter: Kadir Ozdemir
>Priority: Major
> Attachments: PHOENIX-6434.4.x.001.patch, PHOENIX-6434.4.x.002.patch, 
> PHOENIX-6434.4.x.003.patch
>
>
> PHOENIX-5629 introduced the function PHOENIX_ROW_TIMESTAMP() that returns the 
> last modified time of a row. PHOENIX_ROW_TIMESTAMP() can be used as a 
> projection column and referred in a WHERE clause. It is desirable to have 
> indexes on row timestamps. This will result in fast time range queries. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (PHOENIX-6434) Secondary Indexes on PHOENIX_ROW_TIMESTAMP()

2021-04-12 Thread Lars Hofhansl (Jira)


[ 
https://issues.apache.org/jira/browse/PHOENIX-6434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17319683#comment-17319683
 ] 

Lars Hofhansl commented on PHOENIX-6434:


And even worse (again with or without this):
{code:java}
> create table test2(pk1 integer not null primary key, v1 float, v2 float, v3 
> float);
No rows affected (1.418 seconds)
> upsert into test2 values(rand() * 1, rand(), rand(), rand());
1 row affected (0.185 seconds)
> select * from test2 order by phoenix_row_timestamp();

org.apache.hadoop.hbase.DoNotRetryIOException: 
org.apache.hadoop.hbase.DoNotRetryIOException: 
TEST2,,1618257122882.f93ab0ca1bf32530d879c55908b6326c
.: Qualifier 11 is out of the valid range - (0, 0)

at org.apache.phoenix.util.ServerUtil.createIOException(ServerUtil.java:114)
at org.apache.phoenix.util.ServerUtil.throwIOException(ServerUtil.java:80)
at 
org.apache.phoenix.iterate.RegionScannerFactory$1.nextRaw(RegionScannerFactory.java:271)
at 
org.apache.phoenix.iterate.RegionScannerResultIterator.next(RegionScannerResultIterator.java:65)
at 
org.apache.phoenix.iterate.OrderedResultIterator.getResultIterator(OrderedResultIterator.java:284)
at 
org.apache.phoenix.iterate.OrderedResultIterator.next(OrderedResultIterator.java:260)
at 
org.apache.phoenix.iterate.NonAggregateRegionScannerFactory.getTopNScanner(NonAggregateRegionScannerFactory.java:356)
at 
org.apache.phoenix.iterate.NonAggregateRegionScannerFactory.getRegionScanner(NonAggregateRegionScannerFactory.java:186)
at 
org.apache.phoenix.coprocessor.ScanRegionObserver.doPostScannerOpen(ScanRegionObserver.java:194)
at 
org.apache.phoenix.coprocessor.BaseScannerRegionObserver$RegionScannerHolder.overrideDelegate(BaseScannerRegionObserver.java:273)
at 
org.apache.phoenix.coprocessor.BaseScannerRegionObserver$RegionScannerHolder.nextRaw(BaseScannerRegionObserver.java:321)
at 
org.apache.hadoop.hbase.regionserver.RSRpcServices.scan(RSRpcServices.java:3307)
at 
org.apache.hadoop.hbase.regionserver.RSRpcServices.scan(RSRpcServices.java:3557)
at 
org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos$ClientService$2.callBlockingMethod(ClientProtos.java:45253)
{code}
 

> Secondary Indexes on PHOENIX_ROW_TIMESTAMP()
> 
>
> Key: PHOENIX-6434
> URL: https://issues.apache.org/jira/browse/PHOENIX-6434
> Project: Phoenix
>  Issue Type: Improvement
>Affects Versions: 5.1.0, 4.16.0
>Reporter: Kadir Ozdemir
>Priority: Major
> Attachments: PHOENIX-6434.4.x.001.patch, PHOENIX-6434.4.x.002.patch, 
> PHOENIX-6434.4.x.003.patch
>
>
> PHOENIX-5629 introduced the function PHOENIX_ROW_TIMESTAMP() that returns the 
> last modified time of a row. PHOENIX_ROW_TIMESTAMP() can be used as a 
> projection column and referred in a WHERE clause. It is desirable to have 
> indexes on row timestamps. This will result in fast time range queries. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (PHOENIX-6434) Secondary Indexes on PHOENIX_ROW_TIMESTAMP()

2021-04-12 Thread Lars Hofhansl (Jira)


[ 
https://issues.apache.org/jira/browse/PHOENIX-6434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17319680#comment-17319680
 ] 

Lars Hofhansl commented on PHOENIX-6434:


Tried it and works.

There's a funny thing I noticed (which happens *with or without* this issue):
{code:java}
> create table test2(pk1 integer not null primary key, x.v1float, y.v2 float, 
> z.v3 float);
No rows affected (1.418 seconds)
> upsert into test2 values(rand() * 1, rand(), rand(), rand());
1 row affected (0.185 seconds)
> select * from test2 order by 
> phoenix_row_timestamp();+--+--++---+
|   PK1|  V1  | V2 |V3 |
+--+--++---+
| 48717214 | null | 0.54710484 | 0.8657283 |
+--+--++---+
1 row selected (0.06 seconds)
-- Note how v1 is NULL!
> select v1 from test2 order by phoenix_row_timestamp();
+---+
|V1 |
+---+
| 0.3282114 |
+---+
1 row selected (0.023 seconds)
{code}

> Secondary Indexes on PHOENIX_ROW_TIMESTAMP()
> 
>
> Key: PHOENIX-6434
> URL: https://issues.apache.org/jira/browse/PHOENIX-6434
> Project: Phoenix
>  Issue Type: Improvement
>Affects Versions: 5.1.0, 4.16.0
>Reporter: Kadir Ozdemir
>Priority: Major
> Attachments: PHOENIX-6434.4.x.001.patch, PHOENIX-6434.4.x.002.patch, 
> PHOENIX-6434.4.x.003.patch
>
>
> PHOENIX-5629 introduced the function PHOENIX_ROW_TIMESTAMP() that returns the 
> last modified time of a row. PHOENIX_ROW_TIMESTAMP() can be used as a 
> projection column and referred in a WHERE clause. It is desirable to have 
> indexes on row timestamps. This will result in fast time range queries. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (PHOENIX-6434) Secondary Indexes on PHOENIX_ROW_TIMESTAMP()

2021-04-12 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/PHOENIX-6434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17319611#comment-17319611
 ] 

ASF GitHub Bot commented on PHOENIX-6434:
-

kadirozde opened a new pull request #1194:
URL: https://github.com/apache/phoenix/pull/1194


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Secondary Indexes on PHOENIX_ROW_TIMESTAMP()
> 
>
> Key: PHOENIX-6434
> URL: https://issues.apache.org/jira/browse/PHOENIX-6434
> Project: Phoenix
>  Issue Type: Improvement
>Affects Versions: 5.1.0, 4.16.0
>Reporter: Kadir Ozdemir
>Priority: Major
> Attachments: PHOENIX-6434.4.x.001.patch, PHOENIX-6434.4.x.002.patch, 
> PHOENIX-6434.4.x.003.patch
>
>
> PHOENIX-5629 introduced the function PHOENIX_ROW_TIMESTAMP() that returns the 
> last modified time of a row. PHOENIX_ROW_TIMESTAMP() can be used as a 
> projection column and referred in a WHERE clause. It is desirable to have 
> indexes on row timestamps. This will result in fast time range queries. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (PHOENIX-6434) Secondary Indexes on PHOENIX_ROW_TIMESTAMP()

2021-04-09 Thread Hadoop QA (Jira)


[ 
https://issues.apache.org/jira/browse/PHOENIX-6434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17318359#comment-17318359
 ] 

Hadoop QA commented on PHOENIX-6434:


| (x) *{color:red}-1 overall{color}* |
\\
\\
|| Vote || Subsystem || Runtime || Comment ||
| {color:blue}0{color} | {color:blue} reexec {color} | {color:blue}  7m 
25s{color} | {color:blue} Docker mode activated. {color} |
|| || || || {color:brown} Prechecks {color} ||
| {color:green}+1{color} | {color:green} dupname {color} | {color:green}  0m  
0s{color} | {color:green} No case conflicting files found. {color} |
| {color:green}+1{color} | {color:green} hbaseanti {color} | {color:green}  0m  
0s{color} | {color:green} Patch does not have any anti-patterns. {color} |
| {color:green}+1{color} | {color:green} @author {color} | {color:green}  0m  
0s{color} | {color:green} The patch does not contain any @author tags. {color} |
| {color:green}+1{color} | {color:green} test4tests {color} | {color:green}  0m 
 0s{color} | {color:green} The patch appears to include 1 new or modified test 
files. {color} |
|| || || || {color:brown} 4.x Compile Tests {color} ||
| {color:green}+1{color} | {color:green} mvninstall {color} | {color:green} 15m 
 8s{color} | {color:green} 4.x passed {color} |
| {color:green}+1{color} | {color:green} compile {color} | {color:green}  1m  
5s{color} | {color:green} 4.x passed {color} |
| {color:green}+1{color} | {color:green} checkstyle {color} | {color:green}  1m 
30s{color} | {color:green} 4.x passed {color} |
| {color:green}+1{color} | {color:green} javadoc {color} | {color:green}  0m 
48s{color} | {color:green} 4.x passed {color} |
| {color:blue}0{color} | {color:blue} spotbugs {color} | {color:blue}  3m 
18s{color} | {color:blue} phoenix-core in 4.x has 940 extant spotbugs warnings. 
{color} |
|| || || || {color:brown} Patch Compile Tests {color} ||
| {color:green}+1{color} | {color:green} mvninstall {color} | {color:green}  6m 
49s{color} | {color:green} the patch passed {color} |
| {color:green}+1{color} | {color:green} compile {color} | {color:green}  1m  
4s{color} | {color:green} the patch passed {color} |
| {color:green}+1{color} | {color:green} javac {color} | {color:green}  1m  
4s{color} | {color:green} the patch passed {color} |
| {color:red}-1{color} | {color:red} checkstyle {color} | {color:red}  1m 
37s{color} | {color:red} phoenix-core: The patch generated 59 new + 4435 
unchanged - 11 fixed = 4494 total (was 4446) {color} |
| {color:red}-1{color} | {color:red} whitespace {color} | {color:red}  0m  
1s{color} | {color:red} The patch 1 line(s) with tabs. {color} |
| {color:green}+1{color} | {color:green} javadoc {color} | {color:green}  0m 
44s{color} | {color:green} the patch passed {color} |
| {color:red}-1{color} | {color:red} spotbugs {color} | {color:red}  3m 
26s{color} | {color:red} phoenix-core generated 2 new + 940 unchanged - 0 fixed 
= 942 total (was 940) {color} |
|| || || || {color:brown} Other Tests {color} ||
| {color:red}-1{color} | {color:red} unit {color} | {color:red}197m 54s{color} 
| {color:red} phoenix-core in the patch failed. {color} |
| {color:green}+1{color} | {color:green} asflicense {color} | {color:green}  0m 
40s{color} | {color:green} The patch does not generate ASF License warnings. 
{color} |
| {color:black}{color} | {color:black} {color} | {color:black}242m 10s{color} | 
{color:black} {color} |
\\
\\
|| Reason || Tests ||
| FindBugs | module:phoenix-core |
|  |  Possible null pointer dereference of dataColumn in 
org.apache.phoenix.index.IndexMaintainer$5.addDataColInfo(PTable, Expression)  
Dereferenced at IndexMaintainer.java:dataColumn in 
org.apache.phoenix.index.IndexMaintainer$5.addDataColInfo(PTable, Expression)  
Dereferenced at IndexMaintainer.java:[line 594] |
|  |  Redundant nullcheck of value which is known to be null in 
org.apache.phoenix.schema.tuple.ValueGetterTuple.getValue(byte[], byte[])  
Redundant null check at ValueGetterTuple.java:is known to be null in 
org.apache.phoenix.schema.tuple.ValueGetterTuple.getValue(byte[], byte[])  
Redundant null check at ValueGetterTuple.java:[line 73] |
| Failed junit tests | phoenix.end2end.IndexExtendedIT |
\\
\\
|| Subsystem || Report/Notes ||
| Docker | ClientAPI=1.41 ServerAPI=1.41 base: 
https://ci-hadoop.apache.org/job/PreCommit-PHOENIX-Build/385/artifact/patchprocess/Dockerfile
 |
| JIRA Issue | PHOENIX-6434 |
| JIRA Patch URL | 
https://issues.apache.org/jira/secure/attachment/13023636/PHOENIX-6434.4.x.003.patch
 |
| Optional Tests | dupname asflicense javac javadoc unit spotbugs hbaseanti 
checkstyle compile |
| uname | Linux 2562be59342f 4.15.0-101-generic #102-Ubuntu SMP Mon May 11 
10:07:26 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux |
| Build tool | maven |
| Personality | dev/phoenix-personality.sh |
| git revision | 4.x / d962363 |
| Default Java | Private Build-1.8.0_242-8u242-b08-0ubuntu3~16.04-b08 |
| checkstyle | 

[jira] [Commented] (PHOENIX-6434) Secondary Indexes on PHOENIX_ROW_TIMESTAMP()

2021-04-06 Thread Hadoop QA (Jira)


[ 
https://issues.apache.org/jira/browse/PHOENIX-6434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17315388#comment-17315388
 ] 

Hadoop QA commented on PHOENIX-6434:


| (x) *{color:red}-1 overall{color}* |
\\
\\
|| Vote || Subsystem || Runtime || Comment ||
| {color:blue}0{color} | {color:blue} reexec {color} | {color:blue}  1m 
59s{color} | {color:blue} Docker mode activated. {color} |
|| || || || {color:brown} Prechecks {color} ||
| {color:green}+1{color} | {color:green} dupname {color} | {color:green}  0m  
0s{color} | {color:green} No case conflicting files found. {color} |
| {color:green}+1{color} | {color:green} hbaseanti {color} | {color:green}  0m  
0s{color} | {color:green} Patch does not have any anti-patterns. {color} |
| {color:green}+1{color} | {color:green} @author {color} | {color:green}  0m  
0s{color} | {color:green} The patch does not contain any @author tags. {color} |
| {color:green}+1{color} | {color:green} test4tests {color} | {color:green}  0m 
 0s{color} | {color:green} The patch appears to include 1 new or modified test 
files. {color} |
|| || || || {color:brown} 4.x Compile Tests {color} ||
| {color:green}+1{color} | {color:green} mvninstall {color} | {color:green} 15m 
25s{color} | {color:green} 4.x passed {color} |
| {color:green}+1{color} | {color:green} compile {color} | {color:green}  1m  
5s{color} | {color:green} 4.x passed {color} |
| {color:green}+1{color} | {color:green} checkstyle {color} | {color:green}  1m 
31s{color} | {color:green} 4.x passed {color} |
| {color:green}+1{color} | {color:green} javadoc {color} | {color:green}  0m 
46s{color} | {color:green} 4.x passed {color} |
| {color:blue}0{color} | {color:blue} spotbugs {color} | {color:blue}  3m 
17s{color} | {color:blue} phoenix-core in 4.x has 941 extant spotbugs warnings. 
{color} |
|| || || || {color:brown} Patch Compile Tests {color} ||
| {color:green}+1{color} | {color:green} mvninstall {color} | {color:green}  6m 
41s{color} | {color:green} the patch passed {color} |
| {color:green}+1{color} | {color:green} compile {color} | {color:green}  1m  
5s{color} | {color:green} the patch passed {color} |
| {color:green}+1{color} | {color:green} javac {color} | {color:green}  1m  
5s{color} | {color:green} the patch passed {color} |
| {color:red}-1{color} | {color:red} checkstyle {color} | {color:red}  1m 
35s{color} | {color:red} phoenix-core: The patch generated 79 new + 4411 
unchanged - 35 fixed = 4490 total (was 4446) {color} |
| {color:red}-1{color} | {color:red} whitespace {color} | {color:red}  0m  
0s{color} | {color:red} The patch 1 line(s) with tabs. {color} |
| {color:green}+1{color} | {color:green} javadoc {color} | {color:green}  0m 
46s{color} | {color:green} the patch passed {color} |
| {color:red}-1{color} | {color:red} spotbugs {color} | {color:red}  3m 
31s{color} | {color:red} phoenix-core generated 2 new + 941 unchanged - 0 fixed 
= 943 total (was 941) {color} |
|| || || || {color:brown} Other Tests {color} ||
| {color:red}-1{color} | {color:red} unit {color} | {color:red}204m 20s{color} 
| {color:red} phoenix-core in the patch failed. {color} |
| {color:green}+1{color} | {color:green} asflicense {color} | {color:green}  0m 
37s{color} | {color:green} The patch does not generate ASF License warnings. 
{color} |
| {color:black}{color} | {color:black} {color} | {color:black}243m 24s{color} | 
{color:black} {color} |
\\
\\
|| Reason || Tests ||
| FindBugs | module:phoenix-core |
|  |  Possible null pointer dereference of dataColumn in 
org.apache.phoenix.index.IndexMaintainer$5.addDataColInfo(PTable, Expression)  
Dereferenced at IndexMaintainer.java:dataColumn in 
org.apache.phoenix.index.IndexMaintainer$5.addDataColInfo(PTable, Expression)  
Dereferenced at IndexMaintainer.java:[line 594] |
|  |  Redundant nullcheck of value which is known to be null in 
org.apache.phoenix.schema.tuple.ValueGetterTuple.getValue(byte[], byte[])  
Redundant null check at ValueGetterTuple.java:is known to be null in 
org.apache.phoenix.schema.tuple.ValueGetterTuple.getValue(byte[], byte[])  
Redundant null check at ValueGetterTuple.java:[line 73] |
| Failed junit tests | phoenix.end2end.TimezoneOffsetFunctionIT |
|   | phoenix.end2end.WALAnnotationIT |
|   | phoenix.end2end.salted.SaltedTableIT |
|   | phoenix.end2end.UseSchemaIT |
|   | phoenix.end2end.DecodeFunctionIT |
|   | phoenix.end2end.join.HashJoinLocalIndexIT |
|   | phoenix.end2end.DistinctPrefixFilterIT |
|   | phoenix.schema.stats.NoOpStatsCollectorIT |
|   | phoenix.end2end.AlterTableIT |
|   | phoenix.end2end.ArithmeticQueryIT |
|   | phoenix.end2end.InListIT |
|   | phoenix.end2end.ConcurrentUpsertsWithoutIndexedColsIT |
|   | phoenix.end2end.QueryMoreIT |
|   | phoenix.end2end.ReverseScanIT |
|   | phoenix.end2end.RenewLeaseIT |
|   | phoenix.end2end.ConnectionUtilIT |
|   | phoenix.end2end.PointInTimeScanQueryIT |
|   | phoenix.end2end.NumericArithmeticIT |
|   |