in Education by
Hi guys simple question for experienced guys. I have a spark job reading files under a path. I wanted to use structured streaming even when the source is not really a stream but just a folder with a bunch of files in it. My question can I use trigger.Once() for this. And if yes how do I make trigger.Once recognizing new files as such. I tried it out on my laptop and the first run reads everything but when I start the job again files written in the mean time are not recognized and processed at all. my method looks like this: def executeSql(spark:SparkSession):Unit ={ val file = "home/hansherrlich/input_event/" val df = spark.readStream.format("json").schema(getStruct).load("home/hansherrlich/some_event/") val out = df.writeStream.trigger(Trigger.Once()).format("json").option("path","home/hansherrlich/some_event_processed/").start() out.processAllAvailable() out.stop() //out.awaitTermination() println("done writing") } JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
if reading from files this seems only to work if files where written Delta by Data Bricks.

Related questions

0 votes
    so I am constructing a recommedation model using ALS package And make all user-product list by cartesian ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 8, 2022 in Education by JackTerrance
0 votes
    I am trying to write code for converting data in Java RDD to a histogram so that I can bin the data in a certain ... (EntryWithSize entry) { long size = entry.getSize(); if (size...
asked Apr 9, 2022 in Education by JackTerrance
0 votes
    Definition says: RDD is immutable distributed collection of objects I don't quite understand what does it mean. Is ... one please help. Select the correct answer from above options...
asked Jan 30, 2022 in Education by JackTerrance
0 votes
    I'm trying to run a spark application using bin/spark-submit. When I reference my application jar inside my local ... version 1.2.1 Select the correct answer from above options...
asked Jan 29, 2022 in Education by JackTerrance
0 votes
    I want to know in simple language what are all the differences between rdd and dataframes? Select the correct answer from above options...
asked Jan 21, 2022 in Education by JackTerrance
0 votes
    Is spark dependent on Hadoop? If not, then I can run Spark without Hadoop right? Will I miss any features if I do Select the correct answer from above options...
asked Jan 21, 2022 in Education by JackTerrance
0 votes
    How can I convert an RDD to a dataframe? I converted a data frame to rdd using .rdd. After processing it I ... convert it back to rdd Select the correct answer from above options...
asked Jan 21, 2022 in Education by JackTerrance
0 votes
    The only metadata retained on a per-consumer basis is the position of the consumer in the log, called ________....
asked Nov 16, 2022 in Education by JackTerrance
0 votes
    Which is the way to provide configuration metadata to Spring? A. Java-based configuration B. Annotation-based configuration C. XML-based configuration file D. All the options...
asked Nov 8, 2022 in Education by JackTerrance
0 votes
    When you upload a CSV file through UI or External Data API, it is recommended to provide the metadata in the format of __________. A. CSV B. JSON C. XML...
asked Nov 1, 2022 in Education by JackTerrance
0 votes
    What is the best way to get and set the meta data for mp3, mp4, avi files etc. with .NET? ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 26, 2022 in Education by JackTerrance
0 votes
    The benefit of the _____ function is that it is the only way to perfectly repressed an R object in an ... Operations of R Programming Select the correct answer from above options...
asked Feb 13, 2022 in Education by JackTerrance
0 votes
    The job of the __________ file is to store important metadata about your package. (a) Description (b) Interface ... of R Programming Select the correct answer from above options...
asked Feb 10, 2022 in Education by JackTerrance
0 votes
    Which of the following library is used to retrieve and acquire statistical data and metadata disseminated in ... Data-Science,Data-Science-Lifecycle,Applications-of-Data-Science...
asked Oct 30, 2021 in Education by JackTerrance
0 votes
    Relational schemas and other metadata about relations are stored in a structure called the ____________ (a) ... Database Interview Questions and Answers for Freshers and Experience...
asked Oct 11, 2021 in Education by JackTerrance
...