chore(format): remove unused processor "FormatSource".
// See the License for the specific language governing permissions and
// limitations under the License.
-use std::borrow::Cow;
use std::io::Cursor;
use std::ops::Not;
use std::sync::Arc;
@@ -27,15 +26,12 @@ use common_datablocks::DataBlock;
use common_datavalues::prelude::*;
use common_exception::ErrorCode;
use common_exception::Result;
-use common_formats::InputFormat;
use common_io::prelude::BufferRead;
use common_io::prelude::BufferReadExt;
use common_io::prelude::BufferReader;
-use common_io::prelude::FileSplitCow;
use common_io::prelude::NestedCheckpointReader;
use common_pipeline_sources::processors::sources::AsyncSource;
use common_pipeline_sources::processors::sources::AsyncSourcer;
-use common_pipeline_sources::processors::sources::SyncSource;
use common_pipeline_transforms::processors::transforms::Transform;
use common_planner::Metadata;
use common_planner::MetadataRef;
@@ -269,48 +265,6 @@ impl Interpreter for InsertInterpreterV2 {
}
}
-struct FormatSource {
- data: String,
- input_format: Arc<dyn InputFormat>,
- blocks: Vec<DataBlock>,
- is_finished: bool,
-}
-
-impl SyncSource for FormatSource {
- const NAME: &'static str = "FormatSource";
-
- fn generate(&mut self) -> Result<Option<DataBlock>> {
- if self.is_finished {
- return Ok(None);
- }
-
- if self.blocks.is_empty() {
- let data_slice = self.data.as_bytes();
- let mut input_state = self.input_format.create_state();
- let skip_size = self
- .input_format
- .skip_header(data_slice, &mut input_state, 0)?;
-
- let split = FileSplitCow {
- path: None,
- start_offset: 0,
- start_row: 0,
- buf: Cow::from(&data_slice[skip_size..]),
- };
- self.blocks = self.input_format.deserialize_complete_split(split)?;
- }
-
- if !self.blocks.is_empty() {
- let block = self.blocks.remove(0);
- if self.blocks.is_empty() {
- self.is_finished = true;
- }
- return Ok(Some(block));
- }
- Ok(None)
- }
-}
-
pub struct ValueSource {
data: String,
ctx: Arc<dyn TableContext>,
