ClickHouse/dbms/include/DB/DataStreams/TabSeparatedRowInputStream.h
2013-05-04 04:05:15 +00:00

35 lines
798 B
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#pragma once
#include <Poco/SharedPtr.h>
#include <DB/Core/Block.h>
#include <DB/IO/ReadBuffer.h>
#include <DB/DataStreams/IRowInputStream.h>
namespace DB
{
/** Поток для ввода данных в формате tsv.
*/
class TabSeparatedRowInputStream : public IRowInputStream
{
public:
/** with_names - в первой строке заголовок с именами столбцов
* with_types - на следующей строке заголовок с именами типов
*/
TabSeparatedRowInputStream(ReadBuffer & istr_, const Block & sample_, bool with_names_ = false, bool with_types_ = false);
bool read(Row & row);
void readPrefix();
private:
ReadBuffer & istr;
const Block sample;
bool with_names;
bool with_types;
DataTypes data_types;
};
}