Граф коммитов

18 Коммитов

Автор SHA1 Сообщение Дата
Sugu Sougoumarane a822e5d7f3 sqltypes: new Value
The new Value implementation is now based on the vitess types.
* The inner interface has now been replaced by typ and val.
* All Values are expected to be consistent with their types.
  For example, an Int64 type must contain a number.
* The functions that build values generally ensure consistency.
* There is a set of 'Trusted' functions that can bypass this
  consistency check. They should be used with care.
* The proto3 conversion functions build the correct Value types
  based on the field types.
* The bson conversion function provides a Repair function that
  allows you to fix up the types after the fact. This should be
  deleted after bson is deprecated.
* The building of Values from a QueryResult is non-trivial because
  the field info is not part of the QueryResult for streaming
  queries. So, the API requires fields to be explicitly passed in.
* Fuctions that encode or convert to native types expect Value
  to be consistent. If not, they panic.
* proto3.QueryResult is considered to be trusted. If it contains
  inconsistent data, it will cause panics.
* The EventStreamer has been fixed to ensure that the fields and
  rows it publishes are trustable: They can used as parameters
  to the Trusted API.
* The Raw() function usage has been minimized. We should see if
  it can be deprecated. This way, we can make Result truly read-only.

There are a few more tweaks that need to be done:
* The Proto3ToResult call plumbing was hacked in to make everything
  work. That part needs cleaning.
* The bind vars don't need to be converted to their native types
  any more.
2015-11-17 12:59:45 -08:00
Sugu Sougoumarane 274cf0c29d proto/query -> querypb
I was bored.
2015-11-12 00:13:54 -08:00
Sugu Sougoumarane 71469f54c5 sqltypes: all code changed to use Result 2015-11-10 00:50:46 -08:00
Sugu Sougoumarane 03dd9b6f32 []mproto.Field -> []*query.Field
This part 1 of the QueryResult revamp. With this change,
vitess does not see any MySQL types. The BSON layer still
sends mysql types for backward compatibility, which will
be deleted once deprecated.
2015-11-09 01:52:07 -08:00
Sugu Sougoumarane ccbe5915c5 sqltypes transition: Inner->inner 2015-11-05 21:19:23 -08:00
Sugu Sougoumarane 5aa0b5c830 proto: add error handling 2015-10-24 18:10:03 -07:00
Sugu Sougoumarane 09d8970259 sqlparser: ast.go lint warnings 2015-10-16 13:53:00 -07:00
Shengzhe Yao fd8ea54111 use uint32 to split string column 2015-09-01 16:48:38 -07:00
Shengzhe Yao 3736372fee fix splitquery related tests.
1. bind variables in SplitQuery should not contain leading ':'.
2. fix custom_sharding.py test to pass through returned bind variables from VTGate.
3. fix SplitQuery tests in Java.
2015-08-17 15:36:07 -07:00
Shengzhe Yao 0c03e61532 fix lint warnings in sqlquery_test.go 2015-08-17 11:08:26 -07:00
Shengzhe Yao 09bff85552 make SplitQuery support VARBINARY column.
1. SplitQuery will split a VARBINARY column as a hex string. That is, it assumes
   the key range is [0x0000000, 0xFFFFFFFF] and then divides the range into
   intervals based on split count.
2. Introduce splitBoundariesStringColumn to handle string column case.
3. Refactor existing SplitQuery in sqlquery.go: create two helper functions
   getColumnType and getColumnMinMax.
2015-08-17 11:08:26 -07:00
Sugu Sougoumarane 1c59d2e9b6 sqlparser: escape keyword names correctly
Fix for issue https://github.com/youtube/vitess/issues/797.
Names that used keywords were not always getting back-quoted
correctly during codegen. This is a comprehensive fix that
covers all such possible cases.
2015-08-03 21:57:03 -07:00
Shengzhe Yao 199aa60881 add SplitColumn field to SplitQuery
1. Add SplitColumn field to SplitQuery so that caller could hint SplitQuery endpoint
   which column is best for splitting query.
2. The split column must be indexed and this will be verified on the server side.
3. coding style fixes suggested by golint.
2015-05-19 17:13:43 -07:00
Anand Henry 03d5254d70 SplitQuery: cosmetic changes 2015-03-18 15:28:53 -07:00
Anand Henry 7a65fb872f SplitQuery: Error handling and session validation
1. Add SessionId to SplitQueryRequest
2. Do not panic if a table contains no rows, just return empty set of
boundaries.
3. Remove panic style error handling and explicitly return errors
2015-03-17 17:00:00 -07:00
Sugu Sougoumarane 996cfdb0a8 tabletserver: fix broken build 2014-10-06 10:33:36 -07:00
Anand Henry 6aad6b432f QuerySplitter: getSplitBoundaries should panic on bad min or max 2014-10-06 09:35:43 -07:00
Anand Henry 06af2f2f09 Vitess MapReduce: Create multiple splits per shard
Currently GetMRSplits creates one split per shard. This change allows
for further splitting within a shard for better parallelism in mappers.
Splits within a shard are created by appending primary key range clauses
to the shard level query.

Changes:
Added SplitQuery RPC to VtTablet
Modified GetMRSplits to accept SQL queries instead of Table and columns
GetMRSplits forwards the query to tablet for splitting via scatterConn
Unit tests
2014-10-06 09:15:19 -07:00