You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by GitBox <gi...@apache.org> on 2022/10/11 08:06:39 UTC

[GitHub] [dolphinscheduler] zixi0825 commented on issue #4283: [Feature] Data Quality Design

zixi0825 commented on issue #4283:
URL: https://github.com/apache/dolphinscheduler/issues/4283#issuecomment-1274268038

   In cdh,adding hive-site.xml
   into /opt/cloudera/parcels/SPARK2/lib/spark2/conf can solve the problem
   
   On Fri, May 20, 2022 at 10:39 AM a092cc ***@***.***> wrote:
   
   > 需要把hive-site.xml 加载到conf中,我 * The SparkRuntimeEnvironment is responsible
   > for creating SparkSession and SparkExecution
   > */
   > @@ -47,14 +52,29 @@ public class SparkRuntimeEnvironment {
   > }
   >
   >  public void prepare() {
   >
   >
   >
   >    -
   >
   >       sparkSession = SparkSession.builder().config(createSparkConf()).getOrCreate();
   >
   >
   >
   >
   >    -
   >
   >       sparkSession = SparkSession.builder().config(createSparkConf())
   >
   >
   >    -
   >
   >               .enableHiveSupport()
   >
   >
   >    -
   >
   >               .getOrCreate();
   >
   >
   >    }
   >
   >    private SparkConf createSparkConf() {
   >    SparkConf conf = new SparkConf();
   >    -
   >
   >       this.config.entrySet()
   >
   >           .forEach(entry -> conf.set(entry.getKey(), String.valueOf(entry.getValue())));
   >
   >
   >    -
   >
   >       conf.set("spark.sql.crossJoin.enabled","true");
   >
   >
   >    -
   >    -
   >
   >       Configuration cf = new Configuration();
   >
   >
   >    -
   >
   >       cf.addResource("hive-site.xml");
   >
   >
   >    -
   >
   >       cf.addResource("hdfs-site.xml");
   >
   >
   >    -
   >
   >       cf.addResource("core-site.xml");
   >
   >
   >    -
   >
   >       for (Map.Entry<String, String> next : cf) {
   >
   >
   >    -
   >
   >           String key = next.getKey();
   >
   >
   >    -
   >
   >           String value = next.getValue();
   >
   >
   >    -
   >
   >           conf.set(key, value);
   >
   >
   >    -
   >
   >       }
   >
   >
   >    -
   >
   >       return conf;
   >
   >
   >    }
   >    是这么加的
   >
   > —
   > Reply to this email directly, view it on GitHub
   > <https://github.com/apache/dolphinscheduler/issues/4283#issuecomment-1132396853>,
   > or unsubscribe
   > <https://github.com/notifications/unsubscribe-auth/ACSUBBCLR5OONOBNTKDT3T3VK33MVANCNFSM4VEFPIRA>
   > .
   > You are receiving this because you were mentioned.Message ID:
   > ***@***.***>
   >
   


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

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