-
Notifications
You must be signed in to change notification settings - Fork 867
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
103 changed files
with
187 additions
and
67,922 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
kyuubi-common/src/main/scala/org/apache/kyuubi/operation/FetchOrientation.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.apache.kyuubi.operation | ||
|
||
import org.apache.hive.service.rpc.thrift.TFetchOrientation | ||
|
||
object FetchOrientation extends Enumeration { | ||
type FetchOrientation = Value | ||
|
||
val FETCH_NEXT, | ||
FETCH_PRIOR, | ||
FETCH_FIRST, | ||
FETCH_LAST, | ||
FETCH_RELATIVE, | ||
FETCH_ABSOLUTE = Value | ||
|
||
def getFetchOrientation(from: TFetchOrientation): FetchOrientation = | ||
from match { | ||
case TFetchOrientation.FETCH_FIRST => FETCH_FIRST | ||
case TFetchOrientation.FETCH_PRIOR => FETCH_PRIOR | ||
case TFetchOrientation.FETCH_RELATIVE => FETCH_RELATIVE | ||
case TFetchOrientation.FETCH_ABSOLUTE => FETCH_ABSOLUTE | ||
case TFetchOrientation.FETCH_LAST => FETCH_LAST | ||
case _ => FETCH_NEXT | ||
} | ||
|
||
def toTFetchOrientation(from: FetchOrientation): TFetchOrientation = { | ||
from match { | ||
case FETCH_FIRST => TFetchOrientation.FETCH_FIRST | ||
case FETCH_LAST => TFetchOrientation.FETCH_LAST | ||
case FETCH_ABSOLUTE => TFetchOrientation.FETCH_ABSOLUTE | ||
case FETCH_RELATIVE => TFetchOrientation.FETCH_RELATIVE | ||
case FETCH_PRIOR => TFetchOrientation.FETCH_PRIOR | ||
case _ => TFetchOrientation.FETCH_NEXT | ||
} | ||
} | ||
} |
62 changes: 62 additions & 0 deletions
62
kyuubi-common/src/main/scala/org/apache/kyuubi/operation/OperationType.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.apache.kyuubi.operation | ||
|
||
import org.apache.hive.service.rpc.thrift.TOperationType | ||
|
||
object OperationType extends Enumeration { | ||
|
||
type OperationType = Value | ||
val UNKNOWN_OPERATION, | ||
EXECUTE_STATEMENT, | ||
GET_TYPE_INFO, | ||
GET_CATALOGS, | ||
GET_SCHEMAS, | ||
GET_TABLES, | ||
GET_TABLE_TYPES, | ||
GET_COLUMNS, | ||
GET_FUNCTIONS = Value | ||
|
||
def getOperationType(from: TOperationType): OperationType = { | ||
from match { | ||
case TOperationType.EXECUTE_STATEMENT => EXECUTE_STATEMENT | ||
case TOperationType.GET_TYPE_INFO => GET_TYPE_INFO | ||
case TOperationType.GET_CATALOGS => GET_CATALOGS | ||
case TOperationType.GET_SCHEMAS => GET_SCHEMAS | ||
case TOperationType.GET_TABLES => GET_TABLES | ||
case TOperationType.GET_TABLE_TYPES => GET_TABLE_TYPES | ||
case TOperationType.GET_COLUMNS => GET_COLUMNS | ||
case TOperationType.GET_FUNCTIONS => GET_FUNCTIONS | ||
case _ => UNKNOWN_OPERATION | ||
} | ||
} | ||
|
||
def toTOperationType(from: OperationType): TOperationType = { | ||
from match { | ||
case EXECUTE_STATEMENT => TOperationType.EXECUTE_STATEMENT | ||
case GET_TYPE_INFO => TOperationType.GET_TYPE_INFO | ||
case GET_CATALOGS => TOperationType.GET_CATALOGS | ||
case GET_SCHEMAS => TOperationType.GET_SCHEMAS | ||
case GET_TABLES => TOperationType.GET_TABLES | ||
case GET_TABLE_TYPES => TOperationType.GET_TABLE_TYPES | ||
case GET_COLUMNS => TOperationType.GET_COLUMNS | ||
case GET_FUNCTIONS => TOperationType.GET_FUNCTIONS | ||
case _ => TOperationType.UNKNOWN | ||
} | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
kyuubi-common/src/test/scala/org/apache/kyuubi/operation/FetchOrientationSuite.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.apache.kyuubi.operation | ||
|
||
import org.apache.hive.service.rpc.thrift.TFetchOrientation | ||
|
||
import org.apache.kyuubi.KyuubiFunSuite | ||
|
||
class FetchOrientationSuite extends KyuubiFunSuite { | ||
|
||
test("getFetchOrientation") { | ||
val get = FetchOrientation.getFetchOrientation _ | ||
assert(get(TFetchOrientation.FETCH_ABSOLUTE) === FetchOrientation.FETCH_ABSOLUTE) | ||
assert(get(TFetchOrientation.FETCH_FIRST) === FetchOrientation.FETCH_FIRST) | ||
assert(get(TFetchOrientation.FETCH_LAST) === FetchOrientation.FETCH_LAST) | ||
assert(get(TFetchOrientation.FETCH_RELATIVE) === FetchOrientation.FETCH_RELATIVE) | ||
assert(get(TFetchOrientation.FETCH_PRIOR) === FetchOrientation.FETCH_PRIOR) | ||
assert(get(TFetchOrientation.FETCH_NEXT) === FetchOrientation.FETCH_NEXT) | ||
} | ||
|
||
test("toTFetchOrientation") { | ||
val to = FetchOrientation.toTFetchOrientation _ | ||
assert(to(FetchOrientation.FETCH_ABSOLUTE) === TFetchOrientation.FETCH_ABSOLUTE) | ||
assert(to(FetchOrientation.FETCH_FIRST) === TFetchOrientation.FETCH_FIRST) | ||
assert(to(FetchOrientation.FETCH_LAST) === TFetchOrientation.FETCH_LAST) | ||
assert(to(FetchOrientation.FETCH_RELATIVE) === TFetchOrientation.FETCH_RELATIVE) | ||
assert(to(FetchOrientation.FETCH_PRIOR) === TFetchOrientation.FETCH_PRIOR) | ||
assert(to(FetchOrientation.FETCH_NEXT) === TFetchOrientation.FETCH_NEXT) | ||
} | ||
|
||
} |
This file was deleted.
Oops, something went wrong.
25 changes: 0 additions & 25 deletions
25
kyuubi-hive-thrift/src/gen/scala/scrooge/org/apache/hive/service/rpc/thrift/Constants.scala
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.