Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,7 @@ jobs:
run: ./gradlew :dagger-core:minimalAndShadowPublish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish Zip Package of dagger-py-functions
run: ./gradlew publishPyZipPublicationToGitHubPackagesRepository
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49 changes: 47 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,25 @@
buildscript {
repositories {
mavenLocal()
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
}

}

plugins {
id 'maven-publish'
}

ext {
flinkVersion = System.getenv('flinkVersion') ?: '1.14.3'
}

def pyZipVersion = rootProject.file('version.txt').text.trim()
group 'io.odpf'

subprojects {
repositories {
mavenLocal()
Expand All @@ -15,10 +33,37 @@ subprojects {
apply plugin: 'idea'
apply plugin: 'checkstyle'

group 'io.odpf'

checkstyle {
toolVersion '7.6.1'
configFile rootProject.file("config/checkstyle/checkstyle.xml")
}
}

task makePyZip(type: Zip) {
from fileTree(dir: 'dagger-py-functions')
include '**/*'
archiveName "dagger-py-functions.zip"
destinationDir file("$rootDir/")
}

publishing {
publications {
pyZip(MavenPublication) {
artifact source: makePyZip, extension: 'zip'
groupId group
artifactId 'dagger-py-functions'
version pyZipVersion
}
}

repositories {
maven {
name = "GitHubPackages"
url = "https://maven.pkg.github.com/odpf/dagger"
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
}
}
Empty file added dagger-py-functions/README.md
Empty file.
Empty file.
9 changes: 9 additions & 0 deletions dagger-py-functions/udfs/scalar/sample_udf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from pyflink.table import ScalarFunction, DataTypes
from pyflink.table.udf import udf

class SampleUdf(ScalarFunction):

def eval(self, text: str):
return text + "_added_text"

sample_udf = udf(SampleUdf(), result_type=DataTypes.STRING())