Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 2.3k
Avro Table Provider#910
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Avro Table Provider #910
Changes from all commits
7e14f910f940ab2ca7ccbfcbf43bbae2f00a352dadd42cdd1cbdc9c77d6078e44cfa876ef92d801cbb18537577a75566d17fdf233697e3a9e1d6df866a59019ea942c84ee28a9edac57e8a620645eac7cb4340ac408f759f34b9956ce0904e1e40ef1c79ffbc96b781060c64472ad35c3c8f6ce0db3013faa2152a6cd7f18b4fcaeb2b79158acf06265c9b9e1668b96c9218e2be09a6468df26809c4ecb94b9dcba03a3c2405c63a291637a00f109cea31e02a264858c62d931aa451890b746db767c469File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -25,6 +25,7 @@ use crate::serde::{protobuf, BallistaError}; | ||
| use datafusion::arrow::datatypes::{ | ||
| DataType, Field, IntervalUnit, Schema, SchemaRef, TimeUnit, | ||
| }; | ||
| use datafusion::datasource::avro::AvroFile; | ||
| use datafusion::datasource::{CsvFile, PartitionedFile, TableDescriptor}; | ||
| use datafusion::logical_plan::{ | ||
| window_frames::{WindowFrame, WindowFrameBound, WindowFrameUnits}, | ||
| @@ -793,6 +794,19 @@ impl TryInto<protobuf::LogicalPlanNode> for &LogicalPlan { | ||
| }, | ||
| )), | ||
| }) | ||
| } else if let Some(avro) = source.downcast_ref::<AvroFile>() { | ||
| Ok(protobuf::LogicalPlanNode { | ||
| logical_plan_type: Some(LogicalPlanType::AvroScan( | ||
| protobuf::AvroTableScanNode { | ||
| table_name: table_name.to_owned(), | ||
| path: avro.path().to_owned(), | ||
| projection, | ||
| schema: Some(schema), | ||
| file_extension: avro.file_extension().to_string(), | ||
| filters, | ||
| }, | ||
| )), | ||
| }) | ||
| } else { | ||
| Err(BallistaError::General(format!( | ||
| "logical plan to_proto unsupported table provider {:?}", | ||
| @@ -974,6 +988,7 @@ impl TryInto<protobuf::LogicalPlanNode> for &LogicalPlan { | ||
| FileType::NdJson => protobuf::FileType::NdJson, | ||
| FileType::Parquet => protobuf::FileType::Parquet, | ||
| FileType::CSV => protobuf::FileType::Csv, | ||
| FileType::Avro => protobuf::FileType::Avro, | ||
| }; | ||
| Ok(protobuf::LogicalPlanNode { | ||
| @@ -1098,7 +1113,13 @@ impl TryInto<protobuf::LogicalExprNode> for &Expr { | ||
| ) | ||
| } | ||
| }; | ||
| let arg = &args[0]; | ||
| let arg_expr: Option<Box<protobuf::LogicalExprNode>> = if !args.is_empty() | ||
| { | ||
| let arg = &args[0]; | ||
| Some(Box::new(arg.try_into()?)) | ||
| } else { | ||
| None | ||
| }; | ||
| let partition_by = partition_by | ||
| .iter() | ||
| .map(|e| e.try_into()) | ||
| @@ -1111,7 +1132,7 @@ impl TryInto<protobuf::LogicalExprNode> for &Expr { | ||
| protobuf::window_expr_node::WindowFrame::Frame(window_frame.into()) | ||
| }); | ||
| let window_expr = Box::new(protobuf::WindowExprNode { | ||
| expr: Some(Box::new(arg.try_into()?)), | ||
| expr: arg_expr, | ||
| window_function: Some(window_function), | ||
| partition_by, | ||
| order_by, | ||
| @@ -1284,7 +1305,7 @@ impl TryInto<protobuf::LogicalExprNode> for &Expr { | ||
| Expr::Wildcard => Ok(protobuf::LogicalExprNode { | ||
| expr_type: Some(protobuf::logical_expr_node::ExprType::Wildcard(true)), | ||
| }), | ||
| Expr::TryCast { .. } => unimplemented!(), | ||
| _ => unimplemented!(), | ||
| } | ||
| } | ||
| } | ||
| @@ -1473,6 +1494,9 @@ impl TryInto<protobuf::ScalarFunction> for &BuiltinScalarFunction { | ||
| BuiltinScalarFunction::SHA256 => Ok(protobuf::ScalarFunction::Sha256), | ||
| BuiltinScalarFunction::SHA384 => Ok(protobuf::ScalarFunction::Sha384), | ||
| BuiltinScalarFunction::SHA512 => Ok(protobuf::ScalarFunction::Sha512), | ||
| BuiltinScalarFunction::ToTimestampMillis => { | ||
Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the addition of | ||
| Ok(protobuf::ScalarFunction::Totimestampmillis) | ||
| } | ||
| _ => Err(BallistaError::General(format!( | ||
| "logical_plan::to_proto() unsupported scalar function {:?}", | ||
| self | ||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍