Skip to content

Commit 896f61f

Browse files
committed
make format, fix shims for 4.0+
1 parent 557752e commit 896f61f

3 files changed

Lines changed: 119 additions & 0 deletions

File tree

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
package org.apache.comet.shims
21+
22+
import org.apache.spark.unsafe.types.VariantVal
23+
24+
/**
25+
* Throwing-default implementations for `SpecializedGetters` methods that were added in Spark 4.0:
26+
* `getVariant`. The Janino-generated kernel subclasses `CometInternalRow` and must satisfy every
27+
* abstract method on the interface; without these defaults the compiled class fails its
28+
* abstract-method check at class-load time. `GeographyVal` and `GeometryVal` were added in 4.1,
29+
* so this profile's shim does not override those getters.
30+
*/
31+
trait CometInternalRowShim {
32+
def getVariant(ordinal: Int): VariantVal =
33+
throw new UnsupportedOperationException(
34+
s"${getClass.getSimpleName}: getVariant not supported")
35+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
package org.apache.comet.shims
21+
22+
import org.apache.spark.unsafe.types.{GeographyVal, GeometryVal, VariantVal}
23+
24+
/**
25+
* Throwing-default implementations for `SpecializedGetters` methods added in Spark 4.x:
26+
* `getVariant` (4.0), `getGeography` and `getGeometry` (4.1). The Janino-generated kernel
27+
* subclasses `CometInternalRow` and must satisfy every abstract method on the interface; without
28+
* these defaults the compiled class fails its abstract-method check at class-load time.
29+
*/
30+
trait CometInternalRowShim {
31+
def getVariant(ordinal: Int): VariantVal =
32+
throw new UnsupportedOperationException(
33+
s"${getClass.getSimpleName}: getVariant not supported")
34+
35+
def getGeography(ordinal: Int): GeographyVal =
36+
throw new UnsupportedOperationException(
37+
s"${getClass.getSimpleName}: getGeography not supported")
38+
39+
def getGeometry(ordinal: Int): GeometryVal =
40+
throw new UnsupportedOperationException(
41+
s"${getClass.getSimpleName}: getGeometry not supported")
42+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
package org.apache.comet.shims
21+
22+
import org.apache.spark.unsafe.types.{GeographyVal, GeometryVal, VariantVal}
23+
24+
/**
25+
* Throwing-default implementations for `SpecializedGetters` methods added in Spark 4.x:
26+
* `getVariant` (4.0), `getGeography` and `getGeometry` (4.1). The Janino-generated kernel
27+
* subclasses `CometInternalRow` and must satisfy every abstract method on the interface; without
28+
* these defaults the compiled class fails its abstract-method check at class-load time.
29+
*/
30+
trait CometInternalRowShim {
31+
def getVariant(ordinal: Int): VariantVal =
32+
throw new UnsupportedOperationException(
33+
s"${getClass.getSimpleName}: getVariant not supported")
34+
35+
def getGeography(ordinal: Int): GeographyVal =
36+
throw new UnsupportedOperationException(
37+
s"${getClass.getSimpleName}: getGeography not supported")
38+
39+
def getGeometry(ordinal: Int): GeometryVal =
40+
throw new UnsupportedOperationException(
41+
s"${getClass.getSimpleName}: getGeometry not supported")
42+
}

0 commit comments

Comments
 (0)