You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello
I try to work with scalar data by analogy with the ClickHouse repository. To do this, I made a patch in which I supplemented the list of package types from the client with the value ClientCodes::Scalar. The number of this value is the same as the ServerCodes::Totals, as it was in the ClickHouse repository.
/// Types of packets received from servernamespaceServerCodes {
enum {
Hello = 0, /// Name, version, revision.
Data = 1, /// `Block` of data, may be compressed.
Exception = 2, /// Exception that occurred on server side during query execution.
Progress = 3, /// Query execcution progress: rows and bytes read.
Pong = 4, /// response to Ping sent by client.
EndOfStream = 5, /// All packets were sent.
ProfileInfo = 6, /// Profiling data
Totals = 7, /// Block of totals, may be compressed.
Extremes = 8, /// Block of mins and maxs, may be compressed.
TablesStatusResponse = 9, /// Response to TableStatus.
Log = 10, /// Query execution log.
TableColumns = 11, /// Columns' description for default values calculation
PartUUIDs = 12, /// List of unique parts ids.
ReadTaskRequest = 13, /// String (UUID) describes a request for which next task is needed/// This is such an inverted logic, where server sends requests/// And client returns back response
ProfileEvents = 14, /// Packet with profile events from server.
};
}
/// Types of packets sent by client.namespaceClientCodes {
enum {
Hello = 0, /// Name, version, default database name.
Query = 1, /** Query id, query settings, query processing stage, * compression status, and query text (no INSERT data).*/
Data = 2, /// Data `Block` (e.g. INSERT data), may be compressed.
Cancel = 3, /// Cancel query.
Ping = 4, /// Check server connection.
Scalar = 7, /// Work with Block as scalar. NEW VALUE IS SAME ServerCodes::Totals
};
}
I also added a bool is_scalar parameter to the Client::Impl::SendData to determine the type of record: scalar or data
As a result of executing this query, I expect a block with a single Float64 value, but when running this example, an exception is thrown with the text DB::Exception: Unknown expression identifier '$1' in scope SELECT '$1' AS test. Tell me please how to work with scalar?
The text was updated successfully, but these errors were encountered:
Hi @Seredenko-V ! This looks like a half-baked PR, could you please create one, so it would be much easier to reason about without trying to piece everything together manually?
Hello
I try to work with scalar data by analogy with the ClickHouse repository. To do this, I made a patch in which I supplemented the list of package types from the client with the value
ClientCodes::Scalar
. The number of this value is the same as theServerCodes::Totals
, as it was in the ClickHouse repository.I also added a
bool is_scalar
parameter to theClient::Impl::SendData
to determine the type of record: scalar or dataand added
const std::map<std::string, Block>& blocks
to theClient::Execute
for working with temp tables and scalarsHere is an example of using working with a scalar
As a result of executing this query, I expect a block with a single Float64 value, but when running this example, an exception is thrown with the text
DB::Exception: Unknown expression identifier '$1' in scope SELECT '$1' AS test
. Tell me please how to work with scalar?The text was updated successfully, but these errors were encountered: