Skip to content

Optionally set key and/or value column. - #471

Merged
blackwinter merged 4 commits into
masterfrom
filemapColumns
Oct 17, 2022
Merged

blackwinter merged 4 commits into
masterfrom
filemapColumns

Conversation

@blackwinter

Copy link
Copy Markdown
Member

@TobiasNx

Copy link
Copy Markdown
Contributor

Is this then also usable in metafacture-fix?

@blackwinter

Copy link
Copy Markdown
Member Author

Only after we add the corresponding options to put_filemap().

@dr0i dr0i left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems good to me!

@blackwinter
blackwinter marked this pull request as ready for review October 13, 2022 16:09
@blackwinter

Copy link
Copy Markdown
Member Author

Seems good to me!

Thanks, but wasn't ready for review yet. Can you have another look?

@TobiasNx: Can you do the functional review?

@blackwinter
blackwinter requested review from TobiasNx and dr0i October 13, 2022 16:09
@blackwinter blackwinter assigned dr0i and TobiasNx and unassigned blackwinter Oct 13, 2022
@TobiasNx

Copy link
Copy Markdown
Contributor

I will do an functional review.

@dr0i dr0i left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you update ./metamorph/src/main/resources/schemata/metamorph.xsd ? This is the scheme helping e.g. XML editors validating a Morph.

@blackwinter

Copy link
Copy Markdown
Member Author

Can you update ./metamorph/src/main/resources/schemata/metamorph.xsd ?

Will do, thanks.

This is the scheme helping e.g. XML editors validating a Morph.

Not only editors, Metamorph itself uses it. I just didn't notice since I had foregone the Morph tests.

@blackwinter
blackwinter requested a review from dr0i October 14, 2022 09:12
@dr0i dr0i removed their assignment Oct 14, 2022
@TobiasNx

TobiasNx commented Oct 14, 2022 •

Copy link
Copy Markdown
Contributor

I am still not sure about where to add the options:

	<maps>
		<filemap name="animals" files="multipleColumnLookup/animals.tsv" separator="\t" expectedColumns="-1"/>
	</maps>
	<rules>
		<data source="animal">
			<lookup in="animals" />
		</data>
	</rules>

I cannot run this yet: https://github.com/TobiasNx/notWorkingFlux/tree/main/multipleColumnLookup

Results in :

{ }
{ }
{ }

Expected:

{"animal":"Mammal"}
{"animal":"Bird"}
{"animal":"Insect"}

@TobiasNx TobiasNx assigned blackwinter and TobiasNx and unassigned TobiasNx and blackwinter Oct 14, 2022
@TobiasNx TobiasNx assigned blackwinter and unassigned TobiasNx Oct 14, 2022
@blackwinter

blackwinter commented Oct 14, 2022 •

Copy link
Copy Markdown
Member Author

You have to specify the separator \t as character entity &#09; (or leave it off as it's the default anyway).

@blackwinter blackwinter assigned TobiasNx and unassigned blackwinter Oct 14, 2022
@blackwinter

Copy link
Copy Markdown
Member Author

I am still not sure about where to add the options:

Options go on the filemap specification; Metamorph doesn't have the lookup "shortcut".

@TobiasNx

Copy link
Copy Markdown
Contributor

Okay, i tested it. It seems to work. Great. +1

Since I played around with the same file in different directions with sometimes duplicated values what I would recommend is to document that always the last match is selected: https://github.com/TobiasNx/notWorkingFlux/blob/60a00e538569527d88b69cc518d61b4b9ab9410e/multipleColumnLookup

@TobiasNx TobiasNx left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 But document the selection of last match.

@TobiasNx TobiasNx assigned blackwinter and unassigned TobiasNx Oct 17, 2022
@blackwinter

Copy link
Copy Markdown
Member Author

But document the selection of last match.

Do you want to provide a suggestion? This behaviour has not changed, it's always been like this.

TobiasNx added a commit that referenced this pull request Oct 17, 2022
Comment thread metamorph/src/main/resources/schemata/metamorph.xsd Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants