stoty commented on code in PR #1553: URL: https://github.com/apache/phoenix/pull/1553#discussion_r1085332725
########## phoenix-core/src/main/java/org/apache/phoenix/schema/MetaDataClient.java: ########## @@ -2614,7 +2628,47 @@ else if (!SchemaUtil.isSystemTable(Bytes.toBytes(SchemaUtil.getTableName(schemaN } // Use position as column qualifier if APPEND_ONLY_SCHEMA to prevent gaps in // the column encoding (PHOENIX-4737). - Integer encodedCQ = isPkColumn ? null : isAppendOnlySchema ? Integer.valueOf(ENCODED_CQ_COUNTER_INITIAL_VALUE + position) : cqCounter.getNextQualifier(cqCounterFamily); + Integer encodedCQ = null; + if (!isPkColumn) { + if (colDef.getColumnQualifier() != null && encodingScheme != NON_ENCODED_QUALIFIERS) { + if (cqCounter.getNextQualifier(cqCounterFamily) > ENCODED_CQ_COUNTER_INITIAL_VALUE && + !inputCqCounters.containsKey(cqCounterFamily)) { + throw new SQLExceptionInfo.Builder(SQLExceptionCode.MISSING_CQ) Review Comment: OK -- 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: issues-unsubscr...@phoenix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org