-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Additional Functionality (#13) (#14) * Added intersection and collection support * ST_Collect and ST_CollectAggregate now work alongside each other * Added additional ST* functionality * Minor name fixes * Improved collection ser/de performance * Import fixes * Readme fixes * Readme fixes * Jts upgrade 21.1 (#18) * Additional Functionality (#13) * Added intersection and collection support * ST_Collect and ST_CollectAggregate now work alongside each other * Added additional ST* functionality * Minor name fixes * Improved collection ser/de performance * Import fixes * Readme fixes * Readme fixes * Work on angle functionality and proj4 transform * Added missing files * Added ST_Angle implementations * Added Azimuth * Added ST_Union Aggregate variant * Some fixes following manual tests * Bad version fix * 21.1.x add tests (#20) * Dremio 21.2.x upgrade * Updated WIKI link * Additional Functionality (#13) * Added intersection and collection support * ST_Collect and ST_CollectAggregate now work alongside each other * Added additional ST* functionality * Minor name fixes * Improved collection ser/de performance * Import fixes * Readme fixes * Readme fixes * Additional Functionality (#13) (#15) * Added intersection and collection support * ST_Collect and ST_CollectAggregate now work alongside each other * Added additional ST* functionality * Minor name fixes * Improved collection ser/de performance * Import fixes * Readme fixes * Readme fixes * Work on angle functionality and proj4 transform * Added missing files * Added ST_Angle implementations * Added Azimuth * Added ST_Union Aggregate variant * Some fixes following manual tests * Readme Update * version bump, updated readme * ST_X tests foundations laid down * Checkstyle IDEA * Made improvement with test coverage * A lot more work on tests Better code formatting * Some more relation tests cleanup * Added detekt style checks and fixed CI * Missing detekt plugin configuration * Added output tests * Add Geometry Input Tests * Add Geometry input testing * Added WKB Input tests * Measurement functions testing * Added overlay function tests * Some more overlay function tests * Added codecov * Added GH hosted runners * Coverall migration * Coverall migration * Coverall migration * Coverall migration * Coverall migration * Added some more tests * Added some ST_Transform test functionality * Additional transformation tests * Somme additional transformation tests * Print evaluated geom * Done scaling geometry values * Done scaling geometry values * Improve collection coverage * Remove printing * Added ST_Buffer tests and new variant * Removed new buffer variant * Added coveralls badge Co-authored-by: Idan Sheinberg <[email protected]> * Done with aggregate testing * Done with aggregate testing * Formatting fixes * Dremio compat fixes * Lot's of work on buffer parsing * Code now compiles * Added ST_Buffer tests * Added ST_Buffer tests * Added ST_Buffer tests * Coverage targets * Version alignment * Readme fix Co-authored-by: Idan Sheinberg <[email protected]>
- Loading branch information
1 parent
1f52bad
commit 685e789
Showing
16 changed files
with
782 additions
and
57 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
59 changes: 59 additions & 0 deletions
59
src/main/java/org/sheinbergon/dremio/udf/gis/STBufferParameters.java
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,59 @@ | ||
/** | ||
* 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 | ||
* <p> | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* <p> | ||
* 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.sheinbergon.dremio.udf.gis; | ||
|
||
import com.dremio.exec.expr.SimpleFunction; | ||
import com.dremio.exec.expr.annotations.FunctionTemplate; | ||
import com.dremio.exec.expr.annotations.Output; | ||
import com.dremio.exec.expr.annotations.Param; | ||
import org.apache.arrow.memory.ArrowBuf; | ||
|
||
import javax.inject.Inject; | ||
|
||
@FunctionTemplate( | ||
name = "ST_Buffer", | ||
scope = FunctionTemplate.FunctionScope.SIMPLE, | ||
nulls = FunctionTemplate.NullHandling.NULL_IF_NULL) | ||
public class STBufferParameters implements SimpleFunction { | ||
@Param | ||
org.apache.arrow.vector.holders.NullableVarBinaryHolder binaryInput; | ||
|
||
@Param(constant = true) | ||
org.apache.arrow.vector.holders.Float8Holder radiusInput; | ||
|
||
@Param | ||
org.apache.arrow.vector.holders.NullableVarCharHolder parametersInput; | ||
|
||
@Output | ||
org.apache.arrow.vector.holders.NullableVarBinaryHolder binaryOutput; | ||
|
||
@Inject | ||
ArrowBuf buffer; | ||
|
||
public void setup() { | ||
} | ||
|
||
public void eval() { | ||
org.locationtech.jts.geom.Geometry geom = org.sheinbergon.dremio.udf.gis.util.GeometryHelpers.toGeometry(binaryInput); | ||
java.lang.String parameters = org.sheinbergon.dremio.udf.gis.util.GeometryHelpers.toUTF8String(parametersInput); | ||
org.locationtech.jts.geom.Geometry buffered = org.sheinbergon.dremio.udf.gis.util.GeometryHelpers.buffer(geom, radiusInput.value, parameters); | ||
byte[] bytes = org.sheinbergon.dremio.udf.gis.util.GeometryHelpers.toBinary(buffered); | ||
buffer = buffer.reallocIfNeeded(bytes.length); | ||
org.sheinbergon.dremio.udf.gis.util.GeometryHelpers.populate(bytes, buffer, binaryOutput); | ||
} | ||
} |
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
Oops, something went wrong.