Scala Spark read parquet file from AWS S3 Issue in schema - scala

when we are reading file path: s3://BucketName/tableName/
We are getting partition column in DataSet.
but,
when we are reading file path: s3://BucketName/tableName/dt=2022-01-01/filename
We are not getting partition column in DataSet.
Please suggest here, Thanks in advance !!

Related

Can Confluent S3SourceConnector read a CSV file from S3 bucket?

Do we have any Confluent Kafka in-build Connector to read the data from from S3 bucket from a CSV file.
Can S3SourceConnector do the job for me?
Try using
format.class=io.confluent.connect.s3.format.string.StringFormat
This should read lines from files.
You'd be better suited to use something else to actually parse the data, such as SparkSQL

PySpark mergeSchema on Read operation Parquet vs Avro

I have around 200 parquet files with each parquet file having a different schema and I am trying to read these parquet files using mergeSchema enabled during read and it takes almost 2 hours.
If I instead create equivalent Avro files and try to read them using the mergeSchema option on read ( Available only on Databricks runtime 9.3 LTS ) , it can do the merge within 5 minutes.
Question - Why does Parquet Schema merge on Read take too long whereas the Avro files are faster ?

Write parquet files concurrently with pyspark

In Azure Databricks I would like to write to the same set of parquet files concurrently from multiple notebooks using python / pyspark. I partitioned the target files so the partitions are disjoint / written independently which is supported according to databricks docs.
However I keep getting an error in my cluster logs and one of the concurrent write operations fails:
Py4JJavaError: An error occurred while calling o1033.save.
: org.apache.spark.SparkException: Job aborted.
...
Caused by: org.apache.hadoop.fs.PathIOException: `<filePath>/_SUCCESS': Input/output error: Parallel access to the create path detected. Failing request to honor single writer semantics
Here is the base path of where the parquet files are written to.
Why is this happening? What are the _SUCCESS files even for? Can I disable them somehow to avoid this issue?
_SUCCESS is an empty file which is written at the very end of the process to confirm that everything went fine.
The link you provided is about delta only, which is a special format. Appently, you are trying to write a parquet format file, not a delta format. This is the reason why you are having conflicts.

Is there a way to handle parquet file with INT96 parquet type residing in GCS using Data Fusion?

I want to load a parquet file with INT96 parquet type residing in GCS to BigQuery using Data Fusion.
Created a pipeline with GCS ad BigQuery component without any Wrangler as Wrangler does not support parquet format.
"MapReduce program 'phase-1' failed with error: MapReduce JobId job_1567423947791_0001 failed. Please check the system logs for more details"
Q.1:- Can we check detailed Map reduce log for this job id ? I know we can do this in Cloudera supported Apache Hadoop.
Q.2:- Failure without wrangler is not only occurring in case of parquet but even in case of plain text file. Does Wrangler is mandatory to have in pipeline ?
Q.3:- When we tried Spark Engine instead of Map Reduce it resulted in showing failure reason as “INT96 not yet implemented”. Any work around to overcome this error ? Parquet file without INT96 field got processed successfully.

How to append the streaming log data into an hdfs file in Flume? Does anyone have the MR source code to append the data to a file in hdfs

I need to append the streaming data into hdfs using Flume. Without overwriting the existing log file I need to append the streaming data to existing file in hdfs. Could you please provide links for the MR code for the same.
Flume does not overwrite existing data in hdfs directory by default. It is because, flume save incoming data with folder name appended sink timestamp, such as
Flume.2345234523 so if you run flume again in the same directory in hdfs it will create another file, under the same hdfs path.