Skip to content

Commit

Permalink
format manually
Browse files Browse the repository at this point in the history
Signed-off-by: tabVersion <[email protected]>
  • Loading branch information
tabVersion committed May 8, 2024
1 parent 07c7587 commit fed0cc2
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 35 deletions.
2 changes: 1 addition & 1 deletion src/connector/src/sink/formatter/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ pub trait SinkFormatter {
fn format_chunk(
&self,
chunk: &StreamChunk,
) -> impl Iterator<Item=Result<(Option<Self::K>, Option<Self::V>)>>;
) -> impl Iterator<Item = Result<(Option<Self::K>, Option<Self::V>)>>;
}

/// `tri!` in generators yield `Err` and return `()`
Expand Down
30 changes: 10 additions & 20 deletions src/sqlparser/src/ast/legacy_source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,28 +125,18 @@ pub fn parse_source_schema(p: &mut Parser) -> Result<CompatibleSourceSchema, Par
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub enum SourceSchema {
// Keyword::PROTOBUF ProtobufSchema
Protobuf(ProtobufSchema),
// Keyword::JSON
Json,
// Keyword::DEBEZIUM_JSON
DebeziumJson,
Protobuf(ProtobufSchema), // Keyword::PROTOBUF ProtobufSchema
Json, // Keyword::JSON
DebeziumJson, // Keyword::DEBEZIUM_JSON
DebeziumMongoJson,
// Keyword::UPSERT_JSON
UpsertJson,
// Keyword::AVRO
Avro(AvroSchema),
// Keyword::UpsertAVRO
UpsertAvro(AvroSchema),
// Keyword::MAXWELL
Maxwell,
// Keyword::CANAL_JSON
CanalJson,
// Keyword::CSV
Csv(CsvInfo),
UpsertJson, // Keyword::UPSERT_JSON
Avro(AvroSchema), // Keyword::AVRO
UpsertAvro(AvroSchema), // Keyword::UpsertAVRO
Maxwell, // Keyword::MAXWELL
CanalJson, // Keyword::CANAL_JSON
Csv(CsvInfo), // Keyword::CSV
Native,
// Keyword::DEBEZIUM_AVRO
DebeziumAvro(DebeziumAvroSchema),
DebeziumAvro(DebeziumAvroSchema), // Keyword::DEBEZIUM_AVRO
Bytes,
}

Expand Down
21 changes: 7 additions & 14 deletions src/sqlparser/src/ast/statement.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,20 +154,13 @@ impl Format {
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub enum Encode {
// Keyword::Avro
Avro,
// Keyword::CSV
Csv,
// Keyword::PROTOBUF
Protobuf,
// Keyword::JSON
Json,
// Keyword::BYTES
Bytes,
// Keyword::None
None,
// Keyword::TEXT
Text,
Avro, // Keyword::Avro
Csv, // Keyword::CSV
Protobuf, // Keyword::PROTOBUF
Json, // Keyword::JSON
Bytes, // Keyword::BYTES
None, // Keyword::None
Text, // Keyword::TEXT
Native,
Template,
}
Expand Down

0 comments on commit fed0cc2

Please sign in to comment.