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
{{ message }}
This repository has been archived by the owner on Sep 3, 2019. It is now read-only.
problem
The ResultSet of all-shards query is just union-all of each shard ResultSet
aggregation query: ex) select count(*) from foo;
expect> 1 row ResultSet
current> multiple rows ResultSet
order-by query: ex) select * from foo order by 1;
expect> fully ordered ResultSet
current> partially ordered ResultSet for each shard result
suggestion
merge COUNT(), SUM(), MIN(), MAX(), AVG() query results
step 1
specify merging rule by API
RyeStatement.mergeRs(int operation, int result_col_index, int source_col_index)
RyeStatement.mergeRS(int operation, int result_col_index, int source_col_index, int collation)
operation: SUM, MIN, MAX
RyeStatement.megeRs(int operation, int resultcol_index, int[] source_col_index)
oeration: AVG
source_col_index[0] : index of sum() result column
source_col_index[1] : index of count() result column
value types
SUM: bigint, numeric, double
MIN, MAX: bigint, numeric, double, datetime, date, time, string
collation
How to specify?
Does driver collation rule have same result with server collation rule?
https://docs.oracle.com/javase/6/docs/api/java/text/Collator.html
ex)
SELECT COUNT(*) FROM foo;
SELECT SUM(a) FROM foo;
--> RyeStatement.mergeRS(SUM, 1, 1);
SELECT MIN(a) FROM foo;
--> RyeStatement.mergeRs(MIN, 1, 1);
--> RyeStatement.mergeRs(MIN, 1, 1, collation);
SELECT SUM(a), COUNT(a) FROM foo;
--> RyeStatement.mergeRs(AVG, 1, {1,2})
merge order-by query results
step 1
specify sorting rule by API
SORT_SPEC:
int column_index'
boolean isASCorder;
int collation;
ex)
SELECT int_col, str_col, other_cols from foo ORDER by 1, 2 DESC limit 5
-->
sort_spec[0] = new SORT_SPEC(1, true, 0);
sort_spec[1] = new SORT_SPEC(2, false, collation);
RyeStatement.sortRS(sort_spec, 0, 5);
step 2
Driver itself set the merging or sorting API using server's parsing result.
connection property: merge_resultset=yes|no
prepare result protocol changes
The text was updated successfully, but these errors were encountered: