Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
embulk-parser-none-bin
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Klaus Wölfel
embulk-parser-none-bin
Commits
642f276b
Commit
642f276b
authored
Feb 22, 2016
by
sonots
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename message_key => column_name
parent
922eae0d
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
12 deletions
+12
-12
README.md
README.md
+4
-3
example.yml
example.yml
+2
-3
src/main/java/org/embulk/parser/NoneParserPlugin.java
src/main/java/org/embulk/parser/NoneParserPlugin.java
+6
-6
No files found.
README.md
View file @
642f276b
...
...
@@ -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
```
...
...
example.yml
View file @
642f276b
...
...
@@ -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
src/main/java/org/embulk/parser/NoneParserPlugin.java
View file @
642f276b
...
...
@@ -33,9 +33,9 @@ public class NoneParserPlugin
public
interface
PluginTask
extends
Task
,
LineDecoder
.
DecoderTask
//, TimestampParser.Task
{
@Config
(
"
message_key
"
)
@ConfigDefault
(
"\"
message
\""
)
public
String
get
MessageKey
();
@Config
(
"
column_name
"
)
@ConfigDefault
(
"\"
payload
\""
)
public
String
get
ColumnName
();
}
@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
){
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment