Github user kaspersorensen commented on a diff in the pull request:

    https://github.com/apache/metamodel/pull/72#discussion_r44868818
  
    --- Diff: core/src/main/java/org/apache/metamodel/query/QueryConstants.java 
---
    @@ -0,0 +1,41 @@
    +/**
    + * 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.metamodel.query;
    +
    +import java.util.HashMap;
    +import java.util.Map;
    +
    +/**
    + * This class shall hold all constant configurable variables related to 
Query
    + * parsing
    + * 
    + * @author ashwinrayaprolu
    + *
    + */
    +public final class QueryConstants {
    +   /**
    +    * This field will hold start and end character for delimiter that
    +    * can be used
    +    */
    +   public static final Map<Character, Character> delimiterMap = new 
HashMap<Character, Character>();
    --- End diff --
    
    Some concerns regarding this map/this class:
    
    The map datatype works for the purpose of parsing but isn't really very 
self-explaining when it comes to understanding that key=start-token and 
value=end-token. The map is fine, but it's not API worthy.
    
    Maps are mutable, so anyone can here add and remove delimiters. Bug or 
feature I don't know, but seems unintended and not like the right way to 
support that capability if we wanted it.
    
    Being a public class and a public field it becomes API. I don't think we 
necessarily want to maintain an API for query parsing. The parsing is an 
internal thing mostly and who knows if we one day switch to use e.g. Antlr, 
javacc or whatever parsing framework.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to