You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by GitBox <gi...@apache.org> on 2021/03/02 19:09:37 UTC

[GitHub] [calcite] julianhyde opened a new pull request #2361: Work-in-progress; do not review; do not merge

julianhyde opened a new pull request #2361:
URL: https://github.com/apache/calcite/pull/2361


   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [calcite] julianhyde merged pull request #2361: Work-in-progress; do not review; do not merge

Posted by GitBox <gi...@apache.org>.
julianhyde merged pull request #2361:
URL: https://github.com/apache/calcite/pull/2361


   


-- 
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: commits-unsubscribe@calcite.apache.org

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



[GitHub] [calcite] julianhyde commented on pull request #2361: Work-in-progress; do not review; do not merge

Posted by GitBox <gi...@apache.org>.
julianhyde commented on pull request #2361:
URL: https://github.com/apache/calcite/pull/2361#issuecomment-791739257


   Thanks @vlsi, those changes make sense.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [calcite] vlsi commented on a change in pull request #2361: Work-in-progress; do not review; do not merge

Posted by GitBox <gi...@apache.org>.
vlsi commented on a change in pull request #2361:
URL: https://github.com/apache/calcite/pull/2361#discussion_r588653122



##########
File path: core/src/main/java/org/apache/calcite/DataContexts.java
##########
@@ -0,0 +1,130 @@
+/*
+ * 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;
+
+import org.apache.calcite.adapter.java.JavaTypeFactory;
+import org.apache.calcite.jdbc.CalciteConnection;
+import org.apache.calcite.linq4j.QueryProvider;
+import org.apache.calcite.schema.SchemaPlus;
+
+import com.google.common.collect.ImmutableMap;
+
+import org.checkerframework.checker.nullness.qual.Nullable;
+
+import java.io.Serializable;
+import java.util.Map;
+import java.util.function.Function;
+
+import static java.util.Objects.requireNonNull;
+
+/** Utilities for {@link DataContext}. */
+public class DataContexts {
+  private DataContexts() {
+  }
+
+  /** Instance of {@link DataContext} that has no variables. */
+  public static final DataContext EMPTY = new EmptyDataContext();
+
+  /** Returns an instance of {@link DataContext} with the given map. */
+  public static DataContext of(Map<String, Object> map) {
+    return new MapDataContext(map);
+  }
+
+  /** Returns an instance of {@link DataContext} with the given function. */
+  public static DataContext of(Function<String, Object> fn) {

Review comment:
       ```suggestion
     public static DataContext of(Function<String, ? extends @Nullable Object> fn) {
   ```
   




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [calcite] vlsi commented on a change in pull request #2361: Work-in-progress; do not review; do not merge

Posted by GitBox <gi...@apache.org>.
vlsi commented on a change in pull request #2361:
URL: https://github.com/apache/calcite/pull/2361#discussion_r588655074



##########
File path: core/src/main/java/org/apache/calcite/DataContexts.java
##########
@@ -0,0 +1,130 @@
+/*
+ * 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;
+
+import org.apache.calcite.adapter.java.JavaTypeFactory;
+import org.apache.calcite.jdbc.CalciteConnection;
+import org.apache.calcite.linq4j.QueryProvider;
+import org.apache.calcite.schema.SchemaPlus;
+
+import com.google.common.collect.ImmutableMap;
+
+import org.checkerframework.checker.nullness.qual.Nullable;
+
+import java.io.Serializable;
+import java.util.Map;
+import java.util.function.Function;
+
+import static java.util.Objects.requireNonNull;
+
+/** Utilities for {@link DataContext}. */
+public class DataContexts {
+  private DataContexts() {
+  }
+
+  /** Instance of {@link DataContext} that has no variables. */
+  public static final DataContext EMPTY = new EmptyDataContext();
+
+  /** Returns an instance of {@link DataContext} with the given map. */
+  public static DataContext of(Map<String, Object> map) {

Review comment:
       ```suggestion
     public static DataContext of(Map<String, ? extends Object> map) {
   ```
   
   Null values are not expected, however, `of(mapOf<String, String>(...))` would better be accepted




----------------------------------------------------------------
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:
users@infra.apache.org