Closed ihadoop closed 11 years ago
WK_KKID,WP_CAPTIME 这两个字段是索引字段 STORING (WP_CARPLATE) storing 字段非索引字段的一部分
对啊,所以where后面都是索引字段啊。 select WP_CARPLATE from WP_T_PASSCAR_YYYY_MM where WK_KKID='1398000004' AND WP_CAPTIME>1 and WP_CAPTIME<1376292466807
这个不就是符合这样的用法吗 2013-08-12
13574798
发件人:jaywong notifications@github.com 发送时间:2013-08-12 16:43 主题:Re: [wasp] create index的一个问题 (#17) 收件人:"alibaba/wasp"wasp@noreply.github.com 抄送:"ihadoop"13574798@qq.com
WK_KKID,WP_CAPTIME 这两个字段是索引字段 STORING (WP_CARPLATE) storing 字段非索引字段的一部分 — Reply to this email directly or view it on GitHub.
查询其它字段正常么。建表语句可否发下
select * 就ok
CREATE TABLE WP_T_PASSCAR_YYYY_MM { required string WP_ID;required string WK_KKID;required string WP_DIRECTION;OPTIONAL string WP_LANEID;required string WP_WHICHDAY;required string WP_WHICHTIME;required string WP_CARPLATE;OPTIONAL string WP_CARTYPE;OPTIONAL string WP_PLATECOLOR;OPTIONAL INT32 WP_SPEED;OPTIONAL int64 WP_CAPTIME;OPTIONAL FLOAT WP_SZKXD;OPTIONAL FLOAT WP_PJKXD;OPTIONAL int64 WP_GXSJ;OPTIONAL string WP_PICIP;OPTIONAL string WP_FPIC;OPTIONAL string WP_SPIC;OPTIONAL string WP_PPIC;OPTIONAL string WP_TYPECAR;OPTIONAL string WD_DEVICEID;OPTIONAL string WP_F1PIC;OPTIONAL string WP_S1PIC;} PRIMARY KEY ( WP_ID ), ENTITY GROUP ROOT,ENTITY GROUP KEY(WP_ID)
2013-08-12
13574798
发件人:jaywong notifications@github.com 发送时间:2013-08-12 16:52 主题:Re: [wasp] create index的一个问题 (#17) 收件人:"alibaba/wasp"wasp@noreply.github.com 抄送:"ihadoop"13574798@qq.com
查询其它字段正常么。建表语句可否发下 — Reply to this email directly or view it on GitHub.
Fix [Issue-17]: if select items are only storing columns with a column not found error has been fix.
thx for report :)
创建索引sql如下 : create index trackerCar_YYYY_MM on WP_T_PASSCAR_YYYY_MM (WK_KKID,WP_CAPTIME) STORING (WP_CARPLATE)
查询的sql:
select WP_CARPLATE from WP_T_PASSCAR_YYYY_MM where WK_KKID='1398000004' AND WP_CAPTIME>1 and WP_CAPTIME<1376292466807 查询的时候报错如下:
13/08/12 16:39:10 ERROR result.JdbcResultSet: exception com.alibaba.wasp.jdbc.JdbcSQLException: Column "WP_CARPLATE" not found [42122-1] at com.alibaba.wasp.jdbc.JdbcException.getJdbcSQLException(JdbcException.java:111) at com.alibaba.wasp.jdbc.JdbcException.get(JdbcException.java:93) at com.alibaba.wasp.jdbc.JdbcException.get(JdbcException.java:80) at com.alibaba.wasp.jdbc.result.JdbcResultSet.getColumnIndex(JdbcResultSet.java:2938) at com.alibaba.wasp.jdbc.result.JdbcResultSet.get(JdbcResultSet.java:2993) at com.alibaba.wasp.jdbc.result.JdbcResultSet.getString(JdbcResultSet.java:297) at com.Select.main(Select.java:37) Exception in thread "main" com.alibaba.wasp.jdbc.JdbcSQLException: Column "WP_CARPLATE" not found [42122-1] at com.alibaba.wasp.jdbc.JdbcException.getJdbcSQLException(JdbcException.java:111) at com.alibaba.wasp.jdbc.JdbcException.get(JdbcException.java:93) at com.alibaba.wasp.jdbc.JdbcException.get(JdbcException.java:80) at com.alibaba.wasp.jdbc.result.JdbcResultSet.getColumnIndex(JdbcResultSet.java:2938) at com.alibaba.wasp.jdbc.result.JdbcResultSet.get(JdbcResultSet.java:2993) at com.alibaba.wasp.jdbc.result.JdbcResultSet.getString(JdbcResultSet.java:297) at com.Select.main(Select.java:37)
直接scan 索引表: MM_139800000301000595169098
1398000003\x00\x01\x00\x00\x014\x column=s:WP_CARPLATE, timestamp=1376294153484, value=\xE5\x86\x80A850TH
97\x01%\xD0\x00WP_T_PASSCARYYYY
MM_139800000301000595169115
1398000003\x00\x01\x00\x00\x014\x column=s:rowkey, timestamp=1376294153484, value=WP_T_PASSCAR_YYYY_MM_139800000301000595169115
97\x01%\xD0\x00WP_T_PASSCARYYYY
MM_139800000301000595169115
1398000003\x00\x01\x00\x00\x014\x column=s:WP_CARPLATE, timestamp=1376294125092, value=\xE5\x86\x80A81359
97\x01X\x98\x00WP_T_PASSCARYYYY
MM_139800000301000595169234
1398000003\x00\x01\x00\x00\x014\x column=s:rowkey, timestamp=1376294125092, value=WP_T_PASSCAR_YYYY_MM_139800000301000595169234
97\x01X\x98\x00WP_T_PASSCARYYYY
MM_139800000301000595169234
^C 1398000003\x00\x01\x00\x00\x014\x column=s:WP_CARPLATE, timestamp=1376294131542, value=\xE5\x86\x80O10009
97\x01
h\x00WP_T_PASSCAR_YYYY_MM_ 139800000301000595169276 1398000003\x00\x01\x00\x00\x014\x column=s:rowkey, timestamp=1376294131542, value=WP_T_PASSCAR_YYYY_MM_139800000301000595169276 97\x01
h\x00WP_T_PASSCAR_YYYYMM139800000301000595169276
其实是保存了这个字段的