rubenada commented on code in PR #5189: URL: https://github.com/apache/calcite/pull/5189#discussion_r3811099067
########## core/src/test/java/org/apache/calcite/test/WindowPartitionAliasTest.java: ########## @@ -0,0 +1,79 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to you under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.calcite.test; + +import org.junit.jupiter.api.Test; + +/** + * Tests for column aliases used as {@code PARTITION BY} keys of a window + * aggregate. + * + * <p>SQL allows quoted identifiers to contain almost any character; + * however, the enumerable convention materialises multi-column + * {@code PARTITION BY} keys as fields of a synthetic Java class emitted + * into generated source. Field names that are not valid Java identifiers + * cannot appear there: they must be rejected up front rather than + * producing an obscure compile error later. + */ +class WindowPartitionAliasTest { + + /** A quoted alias that is a valid Java identifier plans and runs + * normally when used as one of several {@code PARTITION BY} keys. The + * projection wraps the aliased column in a computation so field- Review Comment: It means that trimming could transparently remove the "problematic field", hiding the issue (not in this particular test, but on the next ones, which use a problematic alias / identifier name) -- 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]
