Member since
06-02-2020
331
Posts
67
Kudos Received
49
Solutions
My Accepted Solutions
| Title | Views | Posted |
|---|---|---|
| 2794 | 07-11-2024 01:55 AM | |
| 7855 | 07-09-2024 11:18 PM | |
| 6566 | 07-09-2024 04:26 AM | |
| 5901 | 07-09-2024 03:38 AM | |
| 5595 | 06-05-2024 02:03 AM |
08-08-2022
02:39 AM
@ssuja, Has the reply helped resolve your issue? If so, please mark the appropriate reply as the solution, as it will make it easier for others to find the answer in the future.
... View more
07-26-2022
04:17 AM
1 Kudo
Hi Team, CDP uses the "org.apache.spark.internal.io.cloud.PathOutputCommitProtocol" OutputCommitter which does not support dynamicPartitionOverwrite. You can set the following parameters into your spark job. code level: spark.conf.set("spark.sql.sources.partitionOverwriteMode", "dynamic")
spark.conf.set("spark.sql.parquet.output.committer.class", "org.apache.parquet.hadoop.ParquetOutputCommitter")
spark.conf.set("spark.sql.sources.commitProtocolClass", "org.apache.spark.sql.execution.datasources.SQLHadoopMapReduceCommitProtocol") spark-submit/spark-shell: --conf spark.sql.sources.partitionOverwriteMode=dynamic --conf spark.sql.parquet.output.committer.class=org.apache.parquet.hadoop.ParquetOutputCommitter --conf spark.sql.sources.commitProtocolClass=org.apache.spark.sql.execution.datasources.SQLHadoopMapReduceCommitProtocol Note: If you are using S3, you can disable it by specifying spark.cloudera.s3_committers.enabled parameter. --conf spark.cloduera.s3_committers.enabled=false
... View more
04-29-2022
05:29 AM
Hi @JoeR Spark will support reading files with multiple file formats like parquet, orc, json, xml, avro,csv etc. I think there is no direct mechanism to read the data from the payload. If I found a different solution, I will share it with you.
... View more
04-22-2022
06:24 AM
@Rekasri have you resolved your issue? If so, please mark the appropriate reply as the solution, as it will make it easier for others to find the answer in the future.
... View more
04-06-2022
09:06 AM
Hi @RangaReddy, how are you? Even though it's a community to ask questions and ask for help, if the CDH is in EOL, can't you help?
... View more
04-05-2022
12:46 AM
1 Kudo
In this post, we will learn how to create a Kafka topic and produce and consume messages from a Kafka topic. After testing the basic producer and consumer example, we will test it with Spark using spark-examples.jar file.
Creating a Kafka topic:
# kafka bootstrap server
KAFKA_BROKERS="localhost:9092"
# kafka topic name
TOPIC_NAME="word_count_topic"
# group name
GROUP_NAME="spark-kafka-group"
# creating a topic
/opt/cloudera/parcels/CDH/lib/kafka/bin/kafka-topics.sh --create --topic ${TOPIC_NAME} --bootstrap-server ${KAFKA_BROKERS}
# describing a topic
/opt/cloudera/parcels/CDH/lib/kafka/bin/kafka-topics.sh --describe --topic ${TOPIC_NAME} --bootstrap-server ${KAFKA_BROKERS}
Producing messages to Kafka topic:
# producing kafka messages
/opt/cloudera/parcels/CDH/lib/kafka/bin/kafka-console-producer.sh --topic ${TOPIC_NAME} --broker-list ${KAFKA_BROKERS}
Consuming messages from Kafka topic:
# consuming kafka messages
/opt/cloudera/parcels/CDH/lib/kafka/bin/kafka-console-consumer.sh --bootstrap-server ${KAFKA_BROKERS} --group ${GROUP_NAME} --topic ${TOPIC_NAME} --from-beginning
Submitting the Spark KafkaWordCount example:
spark-submit \
--master yarn \
--deploy-mode client \
--packages org.apache.spark:spark-streaming-kafka-0-10_2.11:2.4.7.7.1.7.0-551 \
--repositories https://repository.cloudera.com/artifactory/cloudera-repos/ \
--class org.apache.spark.examples.streaming.DirectKafkaWordCount \
/opt/cloudera/parcels/CDH/lib/spark/examples/jars/spark-examples_*.jar ${KAFKA_BROKERS} ${GROUP_NAME} ${TOPIC_NAME}
... View more
Labels:
02-22-2022
10:35 PM
Hi @Rajeshhadoop I think it is the not right way to ask set of questions in single community article. Please create a new thread for any kind of questions.
... View more
02-08-2022
02:44 PM
1 Kudo
Looking at the serialized data, that seems like the Java binary serialization protocol. It seems to me that the producer is simply writing the HashMap java object directly to Kafka, rather than using a proper serializer (Avro, JSON, String, etc.) You should look into modifying your producer so that you can properly deserialize the data that you're reading from Kafka.
... View more
02-08-2022
05:16 AM
hello Yes i tested without HWC and i'm getting a correct date value. Yes the HWC is not required for external table, but as we are creating a common lib for all hive tables, we prefered use HWC. Here are the steps to reproduce the problem: 1- i'm creating a csv file file.csv with those values: a;1 b;2 c;3 that i save in this path /mypath/db/test/dt=2021-02-10. 2- create an external database : CREATE EXTERNAL TABLE db.test ( col1 string, col2 string) PARTITIONED BY (dt date) ROW FORMAT DELIMITED FIELDS TERMINATED BY '\073' LINES TERMINATED BY '\n' STORED AS TEXTFILE LOCATION '/mypath/db/test'; 3- start a spark shell with HWC import com.hortonworks.hwc.HiveWarehouseSession val hive=HiveWarehouseSession.session(spark).build() hive.table("db.test").select("dt").distinct().show() +--------------+ | dt| +--------------+ |2021-02-09| +--------------+
... View more
02-08-2022
04:29 AM
Hi @kanikach I think we don't have mechanism to tell what are all the changes is happen in current release vs previous release other than approaching to the engineering team. If you want more details changes better you can raise a cloudera case and we will check with eng team and get back to you.
... View more