このページは、お客様の言語ではご利用いただけません。Huawei Cloudは、より多くの言語バージョンを追加するために懸命に取り組んでいます。ご協力ありがとうございました。

Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
Software Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Structured Streaming Functions and Reliability

Updated on 2024-10-23 GMT+08:00

Functions Supported by Structured Streaming

  1. ETL operations on streaming data are supported.
  2. Schema inference and partitioning of streaming DataFrames or Datasets are supported.
  3. Operations on the streaming DataFrames or Datasets are supported, including SQL-like operations without types (such as select, where, and groupBy) and RDD operations with types (such as map, filter, and flatMap).
  4. Aggregation calculation based on Event Time and processing of delay data are supported.
  5. Deduplication of streaming data is supported.
  6. Status computing is supported.
  7. Stream processing tasks can be monitored.
  8. Batch-stream join and stream join are supported.

    The following table lists the supported join operations.

    Left Table

    Right Table

    Supported Join Type

    Description

    Static

    Static

    All types

    In stream processing, join operations with no streaming data involved are supported.

    Stream

    Static

    Inner

    Supported, but stateless.

    Left Outer

    Supported, but stateless.

    Right Outer

    Not supported.

    Full Outer

    Not supported.

    Stream

    Stream

    Inner

    Supported. The watermark or time range can be used to clear status of the left and right tables.

    Left Outer

    Conditionally supported. The watermark can be used to clear status of the left table, and watermark and time range must be used for the right table.

    Right Outer

    Conditionally supported. The watermark can be used to clear status of the right table, and watermark and time range must be used for the left table.

    Full Outer

    Not supported.

Functions Not Supported by Structured Streaming

  1. Multi-stream aggregation is not supported.
  2. The following operations of obtaining multiple rows are not supported: limit, first, and take.
  3. Distinct is not supported.
  4. Sorting is supported only when output mode is complete.
  5. The external connection between streams and static data sets is conditionally supported.
  6. Immediate query and result return on some data sets are not supported.
    • count(): Instead of returning a single count from streaming data sets, it uses ds.groupBy().count() to return a streaming data set containing the running count.
    • foreach(): The ds.writeStream.foreach(...) is used to replace it.
    • show(): The output console sink is used to replace it.

Structured Streaming Reliability

Based on the checkpoint and WAL mechanisms, Structured Streaming provides end-to-end exactly-once error tolerance semantics for the sources that can be replayed and the idempotent sinks that support repeated processing.

  1. You can enable the checkpoint function by setting option ("checkpointLocation", "checkpoint path") in the program.

    When data is restored from checkpoint, the application or configuration may change. Some changes may result in the failure in restoring data from the checkpoint. The restrictions are as follows:

    1. The number or type of sources cannot be changed.
    2. The source type and query statement determine whether the source parameter can change. For example:
      • The parameters related to rate control can be added, deleted, or modified. For example: spark.readStream.format("kafka").option("subscribe", "topic") is changed to spark.readStream.format("kafka").option("subscribe", "topic").option("maxOffsetsPerTrigger", ...).
      • Unexpected problems may occur when the topic/file of the consumption is modified. For example: spark.readStream.format("kafka").option("subscribe", "topic") is changed to spark.readStream.format("kafka").option("subscribe", "newTopic").
    3. The type of sink changes. Specific sinks can be combined. The specific scenarios need to be verified. For example:
      • File sink can be changed to kafka sink. Kafka processes only new data.
      • Kafka sink cannot be changed to file sink.
      • Kafka sink can be changed to foreach sink, and vice versa.
    4. The sink type and query statement determine whether the sink parameter can change. For example:
      • The output path of file sink cannot be changed.
      • The output topic of Kafka sink can be changed.
      • The custom operator code in foreach sink can be changed, but the change result depends on the user code.
    5. The projection, filter, and map-like operations can be changed in some scenarios. For example:
      • Filters can be added and deleted. For example: sdf.selectExpr("a") is changed to sdf.where(...).selectExpr("a").filter(...).
      • When Output schema is the same, projections can be changed. For example: sdf.selectExpr("stringColumn AS json").writeStream is changed to sdf.select(to_json(...).as("json")).writeStream.
      • If Output schema is different, projections can be changed in some conditions. For example: when sdf.selectExpr("a").writeStream is changed to sdf.selectExpr("b").writeStream, no error occurs only when the sink supports schema conversion from a to b.
    6. In some scenarios, the status restoration will fail after status is changed.
      • Streaming aggregation: For example, in the sdf.groupBy("a").agg(...) operation, the type or quantity of the grouping key or the aggregation key cannot be changed.
      • Streaming deduplication: For example, in the sdf.dropDuplicates("a") operation, the type or quantity of the grouping key or the aggregation key cannot be changed.
      • Stream-stream join: For example, in the sdf1.join(sdf2, ...) operation, the schema of the association key cannot be changed, and the join type cannot be changed. Change of other join conditions may lead to uncertainty results.
      • Any status computing: You cannot modify the schema or timeout type of the user-defined status in operations such as sdf.groupByKey(...).mapGroupsWithState(...) and sdf.groupByKey(...).flatMapGroupsWithState(...). While users can change the state-mapping function, the outcome depends on their code. If schema changes are necessary, users can encode or decode the status data into binary data to enable schema migration.
  1. Fault tolerance list of Source

    Sources

    Supported Options

    Fault Tolerance Supported

    Description

    File source

    path: file path, which is mandatory.

    maxFilesPerTrigger: maximum number of files in each trigger. The default value is infinity.

    latestFirst: whether to process limited number of new files. The default value is false.

    fileNameOnly: whether the file name is used as the new file for verification instead of using the complete path. (Default value: false)

    Supported

    Paths with wildcard are supported, but multiple paths separated by commas (,) are not supported.

    Files must be placed in a given directory in atomic mode, which can be implemented through file movement in most file systems.

    Socket Source

    host: IP address of the connected node, which is mandatory.

    port: connected port, which is mandatory.

    Not supported.

    -

    Rate Source

    rowsPerSecond: number of rows generated per second. The default value is 1.

    rampUpTime: rising time before the speed specified by rowsPerSecond is reached.

    numPartitions: concurrency degree for generating data rows.

    Supported

    -

    Kafka Source

    For details, see https://archive.apache.org/dist/spark/docs/3.3.1/structured-streaming-kafka-integration.html.

    Supported

    -

  2. Fault tolerance list of Sink

    Sinks

    Supported Output Mode

    Supported Options

    Fault Tolerance

    Description

    File Sink

    Append

    Path: The specified file format must be specified.

    For details, see APIs in DataFrameWriter.

    exactly-once

    Data can be written to partition tables. Time-based partition is better.

    Kafka Sink

    Append, Update, Complete

    For details, see https://archive.apache.org/dist/spark/docs/3.3.1/structured-streaming-kafka-integration.html.

    at-least-once

    For details, see https://archive.apache.org/dist/spark/docs/3.3.1/structured-streaming-kafka-integration.html.

    Foreach Sink

    Append, Update, Complete

    None

    Depends on ForeachWriter.

    For details, see https://archive.apache.org/dist/spark/docs/3.3.1/structured-streaming-programming-guide.html#using-foreach.

    ForeachBatch Sink

    Append, Update, Complete

    None

    Depends on operator.

    For details, see https://spark.apache.org/docs/latest/structured-streaming-programming-guide.html#using-foreach-and-foreachbatch.

    Console Sink

    Append, Update, Complete

    numRows: number of rows printed in each round. The default value is 20.

    truncate: whether to clear the output when the output is too long. The default value is true.

    Not supported

    -

    Memory Sink

    Append, Complete

    None

    Not supported. In complete mode, the entire table is rebuilt after the query is restarted.

    -

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback