This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.apache.hadoop.fs.{FileStatus, Path} | |
import scala.collection.JavaConversions._ | |
import org.apache.spark.sql.SaveMode._ | |
import org.apache.hudi.{DataSourceReadOptions, DataSourceWriteOptions} | |
import org.apache.hudi.DataSourceWriteOptions._ | |
import org.apache.hudi.common.config.HoodieMetadataConfig | |
import org.apache.hudi.common.fs.FSUtils | |
import org.apache.hudi.common.table.HoodieTableMetaClient |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//////////////////////////////////////////////////////////////// | |
// Load Metadata Table (for validation) | |
//////////////////////////////////////////////////////////////// | |
val metadataTablePath = s"$outputPath/.hoodie/metadata" | |
val targetColStatsIndexColumns = Seq( | |
HoodieMetadataPayload.COLUMN_STATS_FIELD_FILE_NAME, | |
HoodieMetadataPayload.COLUMN_STATS_FIELD_MIN_VALUE, | |
HoodieMetadataPayload.COLUMN_STATS_FIELD_MAX_VALUE, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// NOTE: This relies on the dataset previously ingested in here: | |
// https://gist.github.com/alexeykudinkin/233ce2d365ae4a9833f557de7ed5d1b9 | |
//////////////////////////////////////////////////////////////// | |
// Preparing tables for Querying | |
//////////////////////////////////////////////////////////////// | |
// Temp Table w/ Data Skipping DISABLED | |
val readDF: DataFrame = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################################################################################ | |
# Step 1: Start Pulsar in standalone mode (using Docker) | |
################################################################################ | |
docker run -it -p 6650:6650 -p 8080:8080 --mount source=pulsardata,target=/pulsar/data --mount source=pulsarconf,target=/pulsar/conf apachepulsar/pulsar:2.10.1 bin/pulsar standalone | |
################################################################################ | |
# Step 4: Ingest using Hudi's DeltaStreamer utility | |
################################################################################ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.apache.spark.sql.HoodieUnsafeUtils.createDataFrameFromRows | |
import org.apache.spark.sql.{DataFrame, SparkSession, functions} | |
val spark: SparkSession | |
val adminURL = "http://localhost:8080" | |
val endpointURL = "pulsar://localhost:6650" | |
val topicName = "stonks_test" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Thread 0x7FF9117404C0 (active): "MainThread" | |
main_loop (ray/_private/worker.py:847) | |
<module> (ray/_private/workers/default_worker.py:282) | |
Thread 135051 (active+gil): "AsyncIO Thread: default" | |
_openai_json_generator (rayllm/backend/server/routers/router_app.py:111) | |
stream_response (starlette/responses.py:262) | |
wrap (starlette/responses.py:273) | |
run (threading.py:917) | |
_bootstrap_inner (threading.py:980) | |
_bootstrap (threading.py:937) |