Skip to content

Commit

Permalink
fix: conflicts, sort merged function and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
emptyOVO committed Sep 9, 2024
1 parent ea2adc4 commit 6ac7e98
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 54 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@
* limitations under the License.
*/

package org.apache.inlong.sdk.transform.process.function;
package org.apache.inlong.sdk.transform.process.function.arithmetic;

import org.apache.inlong.sdk.transform.decode.SourceData;
import org.apache.inlong.sdk.transform.process.Context;
import org.apache.inlong.sdk.transform.process.function.TransformFunction;
import org.apache.inlong.sdk.transform.process.operator.OperatorTools;
import org.apache.inlong.sdk.transform.process.parser.ValueParser;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@
* limitations under the License.
*/

package org.apache.inlong.sdk.transform.process.function;
package org.apache.inlong.sdk.transform.process.function.string;

import org.apache.inlong.sdk.transform.decode.SourceData;
import org.apache.inlong.sdk.transform.process.Context;
import org.apache.inlong.sdk.transform.process.function.TransformFunction;
import org.apache.inlong.sdk.transform.process.operator.OperatorTools;
import org.apache.inlong.sdk.transform.process.parser.ValueParser;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@
* limitations under the License.
*/

package org.apache.inlong.sdk.transform.process.function;
package org.apache.inlong.sdk.transform.process.function.string;

import org.apache.inlong.sdk.transform.decode.SourceData;
import org.apache.inlong.sdk.transform.process.Context;
import org.apache.inlong.sdk.transform.process.function.TransformFunction;
import org.apache.inlong.sdk.transform.process.operator.OperatorTools;
import org.apache.inlong.sdk.transform.process.parser.ValueParser;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,45 +15,24 @@
* limitations under the License.
*/

package org.apache.inlong.sdk.transform.process;
package org.apache.inlong.sdk.transform.process.function.arithmetic;

import org.apache.inlong.sdk.transform.decode.SourceDecoderFactory;
import org.apache.inlong.sdk.transform.encode.SinkEncoderFactory;
import org.apache.inlong.sdk.transform.pojo.CsvSourceInfo;
import org.apache.inlong.sdk.transform.pojo.FieldInfo;
import org.apache.inlong.sdk.transform.pojo.KvSinkInfo;
import org.apache.inlong.sdk.transform.pojo.TransformConfig;
import org.apache.inlong.sdk.transform.process.TransformProcessor;

import org.junit.Assert;
import org.junit.Test;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

/**
* TestTransformChrFunctionProcessor
* description: test chr functions in transform processor
*/
public class TestTransformChrFunctionProcessor {

private static final List<FieldInfo> srcFields = new ArrayList<>();
private static final List<FieldInfo> dstFields = new ArrayList<>();
private static final CsvSourceInfo csvSource;
private static final KvSinkInfo kvSink;

static {
for (int i = 1; i < 4; i++) {
FieldInfo field = new FieldInfo();
field.setName("numeric" + i);
srcFields.add(field);
}
FieldInfo field = new FieldInfo();
field.setName("result");
dstFields.add(field);
csvSource = new CsvSourceInfo("UTF-8", '|', '\\', srcFields);
kvSink = new KvSinkInfo("UTF-8", dstFields);
}
public class TestTransformChrFunctionProcessor extends AbstractFunctionArithmeticTestBase {

@Test
public void testChrFunction() throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,43 +15,19 @@
* limitations under the License.
*/

package org.apache.inlong.sdk.transform.process;
package org.apache.inlong.sdk.transform.process.operator;

import org.apache.inlong.sdk.transform.decode.SourceDecoderFactory;
import org.apache.inlong.sdk.transform.encode.SinkEncoderFactory;
import org.apache.inlong.sdk.transform.pojo.CsvSourceInfo;
import org.apache.inlong.sdk.transform.pojo.FieldInfo;
import org.apache.inlong.sdk.transform.pojo.KvSinkInfo;
import org.apache.inlong.sdk.transform.pojo.TransformConfig;
import org.apache.inlong.sdk.transform.process.converter.DoubleConverter;
import org.apache.inlong.sdk.transform.process.converter.LongConverter;
import org.apache.inlong.sdk.transform.process.converter.TypeConverter;
import org.apache.inlong.sdk.transform.process.TransformProcessor;

import org.junit.Assert;
import org.junit.Test;

import java.util.ArrayList;
import java.util.List;

public class TestBetweenAndOperator {

private static final List<FieldInfo> srcFields = new ArrayList<>();
private static final List<FieldInfo> dstFields = new ArrayList<>();
private static final CsvSourceInfo csvSource;
private static final KvSinkInfo kvSink;

static {
srcFields.add(new FieldInfo("numeric1", new DoubleConverter()));
srcFields.add(new FieldInfo("string2", TypeConverter.DefaultTypeConverter()));
srcFields.add(new FieldInfo("numeric3", new DoubleConverter()));
srcFields.add(new FieldInfo("numeric4", new LongConverter()));

FieldInfo field = new FieldInfo();
field.setName("result");
dstFields.add(field);
csvSource = new CsvSourceInfo("UTF-8", '|', '\\', srcFields);
kvSink = new KvSinkInfo("UTF-8", dstFields);
}
public class TestBetweenAndOperator extends AbstractOperatorTestBase {

@Test
public void testBetweenAndOperator() throws Exception {
Expand Down

0 comments on commit 6ac7e98

Please sign in to comment.