kadirozde commented on PR #1701:
URL: https://github.com/apache/phoenix/pull/1701#issuecomment-1791860357

   > The following index does not generate any index rows -
   > 
   > CREATE TABLE IF NOT EXISTS S.T1(OID CHAR(15) NOT NULL,KP CHAR(3) NOT NULL, 
ID1 INTEGER, ID2 VARCHAR, ID3 INTEGER, ROW_ID CHAR(15), COL1 VARCHAR, COL2 
VARCHAR, CREATED_DATE DATE,CREATED_BY CHAR(15),LAST_UPDATE DATE,LAST_UPDATE_BY 
CHAR(15),SYSTEM_MODSTAMP DATE CONSTRAINT pk PRIMARY KEY (OID,KP)) 
MULTI_TENANT=true,COLUMN_ENCODED_BYTES=0;
   > 
   > CREATE INDEX IF NOT EXISTS P_T1_COL1_2_NOT_NULL_INDEX ON S.T1 (KP, COL1, 
COL2) INCLUDE (ID1, ID2, ID3) WHERE COL1 IS NOT NULL AND COL2 IS NOT NULL;
   > 
   > UPSERT INTO S.T1(OID, KP, CREATED_DATE, ID1, ID2, ID3, ROW_ID, COL1, COL2, 
SYSTEM_MODSTAMP) VALUES('00D0x0000000001', '001', now(), 12200, 'id1-0001', 
14566, '00R0r0000000001', 'col1-0001', 'col2-0001', now());
   > 
   > Similar behavior for the following index CREATE INDEX IF NOT EXISTS 
P_T1_ID2_COL1_NOT_NULL_INDEX ON S.T1 (KP, COL1, COL2) INCLUDE (ID1, ID2, ID3) 
WHERE ID2 = 'id1-0001' AND COL1 IS NOT NULL;
   
   Great catch @jpisaac ! The list of cells are searched using a binary search 
during expression evaluation and thus they need to be sorted before evaluated. 
I have just fixed 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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to