Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions changelog.d/24773_support_avro_date_values.fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
The Avro codec now supports decoding Avro Date values.

authors: omwbennett
5 changes: 1 addition & 4 deletions lib/codecs/src/decoding/format/avro.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ impl From<&AvroDeserializerOptions> for AvroSerializerOptions {
pub struct AvroDeserializerOptions {
/// The Avro schema definition.
/// **Note**: The following [`apache_avro::types::Value`] variants are *not* supported:
/// * `Date`
/// * `Decimal`
/// * `Duration`
/// * `Fixed`
Expand Down Expand Up @@ -191,9 +190,7 @@ pub fn try_from(value: AvroValue) -> vector_common::Result<VrlValue> {
}
AvroValue::Boolean(boolean) => Ok(VrlValue::from(boolean)),
AvroValue::Bytes(bytes) => Ok(VrlValue::from(bytes)),
AvroValue::Date(_) => Err(vector_common::Error::from(
"AvroValue::Date is not supported",
)),
AvroValue::Date(days) => Ok(VrlValue::from(days)),
AvroValue::Decimal(_) => Err(vector_common::Error::from(
"AvroValue::Decimal is not supported",
)),
Expand Down
2 changes: 1 addition & 1 deletion lib/codecs/tests/avro.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use vector_core::{config::LogNamespace, event::Event};
#[case(false)]
fn roundtrip_avro_fixtures(
#[files("tests/data/avro/generated/*.avro")]
#[exclude(".*(date|fixed|time_millis).avro")]
#[exclude(".*(fixed|time_millis).avro")]
path: PathBuf,
#[case] reserialize: bool,
) {
Expand Down
2 changes: 1 addition & 1 deletion lib/codecs/tests/bin/generate-avro-fixtures.rs
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,6 @@ fn generate_avro_test_case_record() -> Result<()> {
generate_test_case(schema, value, "record")
}

#[allow(unused)]
fn generate_avro_test_case_date() -> Result<()> {
let schema = r#"
{
Expand Down Expand Up @@ -488,6 +487,7 @@ fn main() -> Result<()> {
generate_avro_test_case_array()?;
generate_avro_test_case_boolean()?;
generate_avro_test_case_bytes()?;
generate_avro_test_case_date()?;
generate_avro_test_case_double()?;
generate_avro_test_case_enum()?;
generate_avro_test_case_float()?;
Expand Down
2 changes: 1 addition & 1 deletion lib/codecs/tests/data/avro/generated/array.avsc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lib/codecs/tests/data/avro/generated/date.avro

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lib/codecs/tests/data/avro/generated/date.avsc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/codecs/tests/data/avro/generated/map.avsc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/codecs/tests/data/avro/generated/time_micros.avsc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/codecs/tests/data/avro/generated/uuid.avsc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@ generated: components: sinks: greptimedb_logs: configuration: {
"""
required: false
type: object: {
examples: [{}]
examples: [{},
]
options: "*": {
description: "Extra header key-value pairs."
required: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,6 @@ generated: components: sinks: websocket_server: configuration: {
description: """
The Avro schema definition.
**Note**: The following [`apache_avro::types::Value`] variants are *not* supported:
* `Date`
* `Decimal`
* `Duration`
* `Fixed`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ generated: components: sources: amqp: configuration: {
description: """
The Avro schema definition.
**Note**: The following [`apache_avro::types::Value`] variants are *not* supported:
* `Date`
* `Decimal`
* `Duration`
* `Fixed`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ generated: components: sources: aws_kinesis_firehose: configuration: {
description: """
The Avro schema definition.
**Note**: The following [`apache_avro::types::Value`] variants are *not* supported:
* `Date`
* `Decimal`
* `Duration`
* `Fixed`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,6 @@ generated: components: sources: aws_s3: configuration: {
description: """
The Avro schema definition.
**Note**: The following [`apache_avro::types::Value`] variants are *not* supported:
* `Date`
* `Decimal`
* `Duration`
* `Fixed`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@ generated: components: sources: aws_sqs: configuration: {
description: """
The Avro schema definition.
**Note**: The following [`apache_avro::types::Value`] variants are *not* supported:
* `Date`
* `Decimal`
* `Duration`
* `Fixed`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ generated: components: sources: datadog_agent: configuration: {
description: """
The Avro schema definition.
**Note**: The following [`apache_avro::types::Value`] variants are *not* supported:
* `Date`
* `Decimal`
* `Duration`
* `Fixed`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ generated: components: sources: demo_logs: configuration: {
description: """
The Avro schema definition.
**Note**: The following [`apache_avro::types::Value`] variants are *not* supported:
* `Date`
* `Decimal`
* `Duration`
* `Fixed`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ generated: components: sources: exec: configuration: {
description: """
The Avro schema definition.
**Note**: The following [`apache_avro::types::Value`] variants are *not* supported:
* `Date`
* `Decimal`
* `Duration`
* `Fixed`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ generated: components: sources: file_descriptor: configuration: {
description: """
The Avro schema definition.
**Note**: The following [`apache_avro::types::Value`] variants are *not* supported:
* `Date`
* `Decimal`
* `Duration`
* `Fixed`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ generated: components: sources: gcp_pubsub: configuration: {
description: """
The Avro schema definition.
**Note**: The following [`apache_avro::types::Value`] variants are *not* supported:
* `Date`
* `Decimal`
* `Duration`
* `Fixed`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ generated: components: sources: heroku_logs: configuration: {
description: """
The Avro schema definition.
**Note**: The following [`apache_avro::types::Value`] variants are *not* supported:
* `Date`
* `Decimal`
* `Duration`
* `Fixed`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ generated: components: sources: http: configuration: {
description: """
The Avro schema definition.
**Note**: The following [`apache_avro::types::Value`] variants are *not* supported:
* `Date`
* `Decimal`
* `Duration`
* `Fixed`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,6 @@ generated: components: sources: http_client: configuration: {
description: """
The Avro schema definition.
**Note**: The following [`apache_avro::types::Value`] variants are *not* supported:
* `Date`
* `Decimal`
* `Duration`
* `Fixed`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ generated: components: sources: http_server: configuration: {
description: """
The Avro schema definition.
**Note**: The following [`apache_avro::types::Value`] variants are *not* supported:
* `Date`
* `Decimal`
* `Duration`
* `Fixed`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ generated: components: sources: kafka: configuration: {
description: """
The Avro schema definition.
**Note**: The following [`apache_avro::types::Value`] variants are *not* supported:
* `Date`
* `Decimal`
* `Duration`
* `Fixed`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ generated: components: sources: mqtt: configuration: {
description: """
The Avro schema definition.
**Note**: The following [`apache_avro::types::Value`] variants are *not* supported:
* `Date`
* `Decimal`
* `Duration`
* `Fixed`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ generated: components: sources: nats: configuration: {
description: """
The Avro schema definition.
**Note**: The following [`apache_avro::types::Value`] variants are *not* supported:
* `Date`
* `Decimal`
* `Duration`
* `Fixed`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ generated: components: sources: pulsar: configuration: {
description: """
The Avro schema definition.
**Note**: The following [`apache_avro::types::Value`] variants are *not* supported:
* `Date`
* `Decimal`
* `Duration`
* `Fixed`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ generated: components: sources: redis: configuration: {
description: """
The Avro schema definition.
**Note**: The following [`apache_avro::types::Value`] variants are *not* supported:
* `Date`
* `Decimal`
* `Duration`
* `Fixed`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ generated: components: sources: socket: configuration: {
description: """
The Avro schema definition.
**Note**: The following [`apache_avro::types::Value`] variants are *not* supported:
* `Date`
* `Decimal`
* `Duration`
* `Fixed`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ generated: components: sources: stdin: configuration: {
description: """
The Avro schema definition.
**Note**: The following [`apache_avro::types::Value`] variants are *not* supported:
* `Date`
* `Decimal`
* `Duration`
* `Fixed`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,6 @@ generated: components: sources: websocket: configuration: {
description: """
The Avro schema definition.
**Note**: The following [`apache_avro::types::Value`] variants are *not* supported:
* `Date`
* `Decimal`
* `Duration`
* `Fixed`
Expand Down
Loading