Skip to content

Commit f69f6b9

Browse files
authored
feat: remove XML input format. (#15540)
* feat: remove XML input format. * fix
1 parent ecf3044 commit f69f6b9

File tree

21 files changed

+3
-652
lines changed

21 files changed

+3
-652
lines changed

Cargo.lock

-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/meta/app/src/principal/file_format.rs

-4
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ impl FileFormatParams {
8585
StageFileFormatType::Json => {
8686
Ok(FileFormatParams::Json(JsonFileFormatParams::default()))
8787
}
88-
StageFileFormatType::Xml => Ok(FileFormatParams::Xml(XmlFileFormatParams::default())),
8988
_ => Err(ErrorCode::IllegalFileFormat(format!(
9089
"Unsupported file format type: {:?}",
9190
format_type
@@ -271,9 +270,6 @@ impl FileFormatParams {
271270
check_option!(p, escape)?;
272271
check_option!(p, nan_display)?;
273272
}
274-
FileFormatParams::Xml(p) => {
275-
check_option!(p, row_tag)?;
276-
}
277273
_ => {}
278274
}
279275
Ok(())

src/meta/app/src/principal/user_stage.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -194,10 +194,10 @@ impl FromStr for StageFileFormatType {
194194
"XML" => Ok(StageFileFormatType::Xml),
195195
"JSON" => Ok(StageFileFormatType::Json),
196196
"ORC" | "AVRO" => Err(format!(
197-
"File format type '{s}' not implemented yet', must be one of ( CSV | TSV | NDJSON | PARQUET | XML)"
197+
"File format type '{s}' not implemented yet', must be one of ( CSV | TSV | NDJSON | PARQUET)"
198198
)),
199199
_ => Err(format!(
200-
"Unknown file format type '{s}', must be one of ( CSV | TSV | NDJSON | PARQUET | XML)"
200+
"Unknown file format type '{s}', must be one of ( CSV | TSV | NDJSON | PARQUET)"
201201
)),
202202
}
203203
}

src/query/ast/src/parser/stage.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ pub fn connection_options(i: Input) -> IResult<BTreeMap<String, String>> {
7777
pub fn format_options(i: Input) -> IResult<FileFormatOptions> {
7878
let option_type = map(
7979
rule! {
80-
TYPE ~ "=" ~ ( TSV | CSV | NDJSON | PARQUET | JSON | XML )
80+
TYPE ~ "=" ~ ( TSV | CSV | NDJSON | PARQUET | JSON )
8181
},
8282
|(_, _, v)| {
8383
(

src/query/formats/src/field_decoder/separated_text.rs

-19
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ use databend_common_io::constants::FALSE_BYTES_NUM;
4040
use databend_common_io::constants::INF_BYTES_LOWER;
4141
use databend_common_io::constants::NAN_BYTES_LOWER;
4242
use databend_common_io::constants::NULL_BYTES_ESCAPE;
43-
use databend_common_io::constants::NULL_BYTES_LOWER;
4443
use databend_common_io::constants::TRUE_BYTES_LOWER;
4544
use databend_common_io::constants::TRUE_BYTES_NUM;
4645
use databend_common_io::cursor_ext::collect_number;
@@ -52,7 +51,6 @@ use databend_common_io::parse_bitmap;
5251
use databend_common_io::parse_to_ewkb;
5352
use databend_common_meta_app::principal::CsvFileFormatParams;
5453
use databend_common_meta_app::principal::TsvFileFormatParams;
55-
use databend_common_meta_app::principal::XmlFileFormatParams;
5654
use jsonb::parse_value;
5755
use lexical_core::FromLexical;
5856
use num_traits::NumCast;
@@ -112,23 +110,6 @@ impl SeparatedTextDecoder {
112110
}
113111
}
114112

115-
pub fn create_xml(_params: &XmlFileFormatParams, options_ext: &FileFormatOptionsExt) -> Self {
116-
SeparatedTextDecoder {
117-
common_settings: InputCommonSettings {
118-
null_if: vec![NULL_BYTES_LOWER.as_bytes().to_vec()],
119-
true_bytes: TRUE_BYTES_LOWER.as_bytes().to_vec(),
120-
false_bytes: FALSE_BYTES_LOWER.as_bytes().to_vec(),
121-
nan_bytes: NAN_BYTES_LOWER.as_bytes().to_vec(),
122-
inf_bytes: INF_BYTES_LOWER.as_bytes().to_vec(),
123-
timezone: options_ext.timezone,
124-
disable_variant_check: options_ext.disable_variant_check,
125-
binary_format: Default::default(),
126-
is_rounding_mode: options_ext.is_rounding_mode,
127-
},
128-
nested_decoder: NestedValues::create(options_ext),
129-
}
130-
}
131-
132113
fn common_settings(&self) -> &InputCommonSettings {
133114
&self.common_settings
134115
}

src/query/pipeline/sources/Cargo.toml

-4
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@ edition = { workspace = true }
1111
doctest = false
1212
test = true
1313

14-
[package.metadata.cargo-machete]
15-
ignored = ["xml-rs"]
16-
1714
[dependencies]
1815
async-backtrace = { workspace = true }
1916
async-channel = "1.7.1"
@@ -45,4 +42,3 @@ serde = { workspace = true }
4542
serde_json = { workspace = true }
4643

4744
typetag = { workspace = true }
48-
xml-rs = "0.8.14"

0 commit comments

Comments
 (0)