You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "liyubin117 (via GitHub)" <gi...@apache.org> on 2023/03/10 08:09:18 UTC

[GitHub] [flink-table-store] liyubin117 opened a new pull request, #592: [FLINK-31292] Correct the default hadoopConf in CatalogContext

liyubin117 opened a new pull request, #592:
URL: https://github.com/apache/flink-table-store/pull/592

   At present, if HadoopConf is not passed in the CatalogContext, a new HadoopConf will be directly generated, which may not have the required parameters. we should correct 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: issues-unsubscribe@flink.apache.org

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


[GitHub] [flink-table-store] JingsongLi commented on a diff in pull request #592: [FLINK-31292] Correct the default hadoopConf in CatalogContext

Posted by "JingsongLi (via GitHub)" <gi...@apache.org>.
JingsongLi commented on code in PR #592:
URL: https://github.com/apache/flink-table-store/pull/592#discussion_r1132071595


##########
flink-table-store-common/src/main/java/org/apache/flink/table/store/utils/HadoopConfUtils.java:
##########
@@ -0,0 +1,112 @@
+/*
+ * 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.flink.table.store.utils;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.hdfs.HdfsConfiguration;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.File;
+
+/**
+ * Utility class for working with Hadoop-related classes. This should only be used if Hadoop is on
+ * the classpath.
+ */
+public class HadoopConfUtils {
+
+    private static final Logger LOG = LoggerFactory.getLogger(HadoopConfUtils.class);
+    public static final String HADOOP_HOME_ENV = "HADOOP_HOME";
+    public static final String HADOOP_CONF_ENV = "HADOOP_CONF_DIR";
+
+    public static Configuration getHadoopConfiguration() {

Review Comment:
   We can pass `Options` in here to support some config options like Flink HadoopUtils.



-- 
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-unsubscribe@flink.apache.org

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


[GitHub] [flink-table-store] JingsongLi commented on a diff in pull request #592: [FLINK-31292] Correct the default hadoopConf in CatalogContext

Posted by "JingsongLi (via GitHub)" <gi...@apache.org>.
JingsongLi commented on code in PR #592:
URL: https://github.com/apache/flink-table-store/pull/592#discussion_r1132176419


##########
flink-table-store-common/src/main/java/org/apache/flink/table/store/utils/HadoopUtils.java:
##########
@@ -0,0 +1,133 @@
+/*
+ * 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.flink.table.store.utils;
+
+import org.apache.flink.table.store.options.Options;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.hdfs.HdfsConfiguration;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.File;
+
+/**
+ * Utility class for working with Hadoop-related classes. This should only be used if Hadoop is on
+ * the classpath. Note: decoupled from specific engines.
+ */
+public class HadoopUtils {
+
+    private static final Logger LOG = LoggerFactory.getLogger(HadoopUtils.class);
+    private static final String[] FLINK_CONFIG_PREFIXES = {"flink.hadoop."};

Review Comment:
   Don't use `flink.`.
   `String[] FLINK_CONFIG_PREFIXES = {"flink.hadoop."}` -> `String[] CONFIG_PREFIXES = {"hadoop."}`.



-- 
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-unsubscribe@flink.apache.org

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


[GitHub] [flink-table-store] liyubin117 commented on a diff in pull request #592: [FLINK-31292] Correct the default hadoopConf in CatalogContext

Posted by "liyubin117 (via GitHub)" <gi...@apache.org>.
liyubin117 commented on code in PR #592:
URL: https://github.com/apache/flink-table-store/pull/592#discussion_r1132096740


##########
flink-table-store-common/src/main/java/org/apache/flink/table/store/utils/HadoopConfUtils.java:
##########
@@ -0,0 +1,112 @@
+/*
+ * 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.flink.table.store.utils;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.hdfs.HdfsConfiguration;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.File;
+
+/**
+ * Utility class for working with Hadoop-related classes. This should only be used if Hadoop is on
+ * the classpath.
+ */
+public class HadoopConfUtils {
+
+    private static final Logger LOG = LoggerFactory.getLogger(HadoopConfUtils.class);
+    public static final String HADOOP_HOME_ENV = "HADOOP_HOME";
+    public static final String HADOOP_CONF_ENV = "HADOOP_CONF_DIR";
+
+    public static Configuration getHadoopConfiguration() {

Review Comment:
   Thanks for your reminds, I wonder if it is reasonable to get extra options like Flink HadoopUtils, as of the feature in common module invoked by Spark/Hive should not rely on Fllink configuration.



-- 
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-unsubscribe@flink.apache.org

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


[GitHub] [flink-table-store] JingsongLi commented on a diff in pull request #592: [FLINK-31292] Correct the default hadoopConf in CatalogContext

Posted by "JingsongLi (via GitHub)" <gi...@apache.org>.
JingsongLi commented on code in PR #592:
URL: https://github.com/apache/flink-table-store/pull/592#discussion_r1132102011


##########
flink-table-store-common/src/main/java/org/apache/flink/table/store/utils/HadoopConfUtils.java:
##########
@@ -0,0 +1,112 @@
+/*
+ * 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.flink.table.store.utils;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.hdfs.HdfsConfiguration;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.File;
+
+/**
+ * Utility class for working with Hadoop-related classes. This should only be used if Hadoop is on
+ * the classpath.
+ */
+public class HadoopConfUtils {
+
+    private static final Logger LOG = LoggerFactory.getLogger(HadoopConfUtils.class);
+    public static final String HADOOP_HOME_ENV = "HADOOP_HOME";
+    public static final String HADOOP_CONF_ENV = "HADOOP_CONF_DIR";
+
+    public static Configuration getHadoopConfiguration() {

Review Comment:
   I think these should be our configuration, `Approach 2: Flink configuration (deprecated)` is deprecated, but approach 4 may looks good:
   ```
   // Approach 4: catalog options
   // add all configuration key with prefix 'hadoop.' in catalog options to hadoop conf
   ```
   Maybe like this?



-- 
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-unsubscribe@flink.apache.org

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


[GitHub] [flink-table-store] liyubin117 commented on a diff in pull request #592: [FLINK-31292] Correct the default hadoopConf in CatalogContext

Posted by "liyubin117 (via GitHub)" <gi...@apache.org>.
liyubin117 commented on code in PR #592:
URL: https://github.com/apache/flink-table-store/pull/592#discussion_r1132129554


##########
flink-table-store-common/src/main/java/org/apache/flink/table/store/utils/HadoopConfUtils.java:
##########
@@ -0,0 +1,112 @@
+/*
+ * 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.flink.table.store.utils;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.hdfs.HdfsConfiguration;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.File;
+
+/**
+ * Utility class for working with Hadoop-related classes. This should only be used if Hadoop is on
+ * the classpath.
+ */
+public class HadoopConfUtils {
+
+    private static final Logger LOG = LoggerFactory.getLogger(HadoopConfUtils.class);
+    public static final String HADOOP_HOME_ENV = "HADOOP_HOME";
+    public static final String HADOOP_CONF_ENV = "HADOOP_CONF_DIR";
+
+    public static Configuration getHadoopConfiguration() {

Review Comment:
   I get it~ to make it clear, do you mean make it like
   `create(options, HadoopConfUtils.getHadoopConfiguration(options))`



-- 
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-unsubscribe@flink.apache.org

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


[GitHub] [flink-table-store] JingsongLi commented on a diff in pull request #592: [FLINK-31292] Correct the default hadoopConf in CatalogContext

Posted by "JingsongLi (via GitHub)" <gi...@apache.org>.
JingsongLi commented on code in PR #592:
URL: https://github.com/apache/flink-table-store/pull/592#discussion_r1132144500


##########
flink-table-store-common/src/main/java/org/apache/flink/table/store/utils/HadoopConfUtils.java:
##########
@@ -0,0 +1,112 @@
+/*
+ * 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.flink.table.store.utils;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.hdfs.HdfsConfiguration;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.File;
+
+/**
+ * Utility class for working with Hadoop-related classes. This should only be used if Hadoop is on
+ * the classpath.
+ */
+public class HadoopConfUtils {
+
+    private static final Logger LOG = LoggerFactory.getLogger(HadoopConfUtils.class);
+    public static final String HADOOP_HOME_ENV = "HADOOP_HOME";
+    public static final String HADOOP_CONF_ENV = "HADOOP_CONF_DIR";
+
+    public static Configuration getHadoopConfiguration() {

Review Comment:
   Yes~



-- 
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-unsubscribe@flink.apache.org

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


[GitHub] [flink-table-store] liyubin117 commented on a diff in pull request #592: [FLINK-31292] Correct the default hadoopConf in CatalogContext

Posted by "liyubin117 (via GitHub)" <gi...@apache.org>.
liyubin117 commented on code in PR #592:
URL: https://github.com/apache/flink-table-store/pull/592#discussion_r1132242833


##########
flink-table-store-common/src/main/java/org/apache/flink/table/store/utils/HadoopUtils.java:
##########
@@ -0,0 +1,133 @@
+/*
+ * 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.flink.table.store.utils;
+
+import org.apache.flink.table.store.options.Options;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.hdfs.HdfsConfiguration;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.File;
+
+/**
+ * Utility class for working with Hadoop-related classes. This should only be used if Hadoop is on
+ * the classpath. Note: decoupled from specific engines.
+ */
+public class HadoopUtils {
+
+    private static final Logger LOG = LoggerFactory.getLogger(HadoopUtils.class);
+    private static final String[] FLINK_CONFIG_PREFIXES = {"flink.hadoop."};

Review Comment:
   done :)



-- 
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-unsubscribe@flink.apache.org

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


[GitHub] [flink-table-store] liyubin117 commented on pull request #592: [FLINK-31292] Correct the default hadoopConf in CatalogContext

Posted by "liyubin117 (via GitHub)" <gi...@apache.org>.
liyubin117 commented on PR #592:
URL: https://github.com/apache/flink-table-store/pull/592#issuecomment-1464752148

   @JingsongLi I have added more tests, please take a look


-- 
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-unsubscribe@flink.apache.org

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


[GitHub] [flink-table-store] liyubin117 commented on a diff in pull request #592: [FLINK-31292] Correct the default hadoopConf in CatalogContext

Posted by "liyubin117 (via GitHub)" <gi...@apache.org>.
liyubin117 commented on code in PR #592:
URL: https://github.com/apache/flink-table-store/pull/592#discussion_r1132129554


##########
flink-table-store-common/src/main/java/org/apache/flink/table/store/utils/HadoopConfUtils.java:
##########
@@ -0,0 +1,112 @@
+/*
+ * 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.flink.table.store.utils;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.hdfs.HdfsConfiguration;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.File;
+
+/**
+ * Utility class for working with Hadoop-related classes. This should only be used if Hadoop is on
+ * the classpath.
+ */
+public class HadoopConfUtils {
+
+    private static final Logger LOG = LoggerFactory.getLogger(HadoopConfUtils.class);
+    public static final String HADOOP_HOME_ENV = "HADOOP_HOME";
+    public static final String HADOOP_CONF_ENV = "HADOOP_CONF_DIR";
+
+    public static Configuration getHadoopConfiguration() {

Review Comment:
   I get it~ to make it clear, do you mean make it like `create(options, HadoopConfUtils.getHadoopConfiguration(options))`



-- 
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-unsubscribe@flink.apache.org

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


[GitHub] [flink-table-store] JingsongLi merged pull request #592: [FLINK-31292] Introduce HadoopUtils to get Configuration in CatalogContext

Posted by "JingsongLi (via GitHub)" <gi...@apache.org>.
JingsongLi merged PR #592:
URL: https://github.com/apache/flink-table-store/pull/592


-- 
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-unsubscribe@flink.apache.org

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