Commit 642f276b authored by sonots's avatar sonots

Rename message_key => column_name

parent 922eae0d
......@@ -15,7 +15,7 @@ $ embulk gem install embulk-parser-none
## Configuration
- **message_key**: A column name which this plugin outputs (string, default: "message")
- **column_name**: A column name which this plugin outputs (string, default: "payload")
## Example
......@@ -25,7 +25,7 @@ in:
path_prefix: example.txt
parser:
type: none
message_key: message
column_name: payload
```
Assume the input file (example.txt) is as following:
......@@ -39,7 +39,7 @@ then this plugin treats as:
```
+----------------+
| message:string |
| payload:string |
+----------------+
| foo bar baz |
| foo bar baz |
......@@ -82,6 +82,7 @@ out:
Run example:
```
$ embulk gem install embulk-formatter-single_value
$ ./gradlew classpath
$ embulk run -I lib example.yml
```
......
......@@ -3,12 +3,11 @@ in:
path_prefix: example.txt
parser:
type: none
message_key: message
column_name: payload
out:
type: file
path_prefix: example.txt
sequence_format: ""
file_ext: .out
formatter:
type: csv
quote_policy: NONE
type: single_value
......@@ -33,9 +33,9 @@ public class NoneParserPlugin
public interface PluginTask
extends Task, LineDecoder.DecoderTask //, TimestampParser.Task
{
@Config("message_key")
@ConfigDefault("\"message\"")
public String getMessageKey();
@Config("column_name")
@ConfigDefault("\"payload\"")
public String getColumnName();
}
@Override
......@@ -43,9 +43,9 @@ public class NoneParserPlugin
{
PluginTask task = config.loadConfig(PluginTask.class);
ArrayList<ColumnConfig> columns = new ArrayList<ColumnConfig>();
final String messageKey = task.getMessageKey();
final String columnName = task.getColumnName();
columns.add(new ColumnConfig(messageKey, STRING ,config));
columns.add(new ColumnConfig(columnName, STRING ,config));
Schema schema = new SchemaConfig(columns).toSchema();
control.run(task.dump(), schema);
......@@ -59,7 +59,7 @@ public class NoneParserPlugin
LineDecoder lineDecoder = new LineDecoder(input,task);
PageBuilder pageBuilder = new PageBuilder(Exec.getBufferAllocator(), schema, output);
String line = null;
final String messageKey = task.getMessageKey();
final String columnName = task.getColumnName();
while( input.nextFile() ){
while(true){
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment