创建phoenix表,其中主键按降序排列

时间:2017-10-24 09:10:52

标签: sql hbase phoenix

我正在尝试创建表格:

public function upload(UploadImageRequest $request)
    {
        $data = Request::input('image_url')) {
            $image = file_get_contents($data);
            $fullName = 'images/'.uniqid().time().'.'.pathinfo($data, PATHINFO_EXTENSION);
            Storage::disk()->put($fullName, $image);

        $image = Image::create([
            'url' => Storage::disk()->url($fullName),
        ]);

        return Response::json($image, ResponseHttp::HTTP_CREATED);
    }

我收到错误

  

错误:ERROR 604(42P00):语法错误。输入不匹配。期待   " RPAREN",得到" desc"在第4行第26列。(state = 42P00,code = 604)   org.apache.phoenix.exception.PhoenixParserException:错误604   (42P00):语法错误。输入不匹配。期待" RPAREN",得到了   "降序"在第4行,第26栏   org.apache.phoenix.exception.PhoenixParserException.newException(PhoenixParserException.java:33)     在   org.apache.phoenix.parse.SQLParser.parseStatement(SQLParser.java:111)     在   org.apache.phoenix.jdbc.PhoenixStatement $ PhoenixStatementParser.parseStatement(PhoenixStatement.java:1280)     在   org.apache.phoenix.jdbc.PhoenixStatement.parseStatement(PhoenixStatement.java:1363)     在   org.apache.phoenix.jdbc.PhoenixStatement.execute(PhoenixStatement.java:1434)     at sqlline.Commands.execute(Commands.java:822)at   sqlline.Commands.sql(Commands.java:732)at   sqlline.SqlLine.dispatch(SqlLine.java:808)at   sqlline.SqlLine.begin(SqlLine.java:681)at   sqlline.SqlLine.start(SqlLine.java:398)at   sqlline.SqlLine.main(SqlLine.java:292)引起:   MismatchedTokenException(41!= 129)at   org.apache.phoenix.parse.PhoenixSQLParser.recoverFromMismatchedToken(PhoenixSQLParser.java:360)     在   org.apache.phoenix.shaded.org.antlr.runtime.BaseRecognizer.match(BaseRecognizer.java:115)     在   org.apache.phoenix.parse.PhoenixSQLParser.create_table_node(PhoenixSQLParser.java:1126)     在   org.apache.phoenix.parse.PhoenixSQLParser.oneStatement(PhoenixSQLParser.java:816)     在   org.apache.phoenix.parse.PhoenixSQLParser.statement(PhoenixSQLParser.java:508)     在   org.apache.phoenix.parse.SQLParser.parseStatement(SQLParser.java:108)     ... 9更多

我想我错过了一些但却无法理解的东西。将不胜感激。

1 个答案:

答案 0 :(得分:2)

Only a primary key can be markeddescascCreatedDateTime不是主键,因此不能降序。