Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#228] Implemented processing of xls files without transformation to csv #285

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

MSattrtand
Copy link
Collaborator

@MSattrtand MSattrtand commented Dec 12, 2024

Resolves #228.

.xls files are now being processed separately, without conversion to .csv. This is preliminary code, I'll work on reducing the amount of duplicate code using adapters and refractor it.

@MSattrtand
Copy link
Collaborator Author

XLS and CSV files are now processed using adapters, will fix the HTML processing soon

@MSattrtand
Copy link
Collaborator Author

Processing HTML tables works again, though it still has its inelegant solution with a conversion to CSV.

@MSattrtand
Copy link
Collaborator Author

HTML tables are now being processed directly, without conversion. However, I'm not sure that won't introduce more bugs because HTML doesn't store info of all the cells in every row, so I have to use a workaround to remember if we should have merged cells in every place.

Copy link
Contributor

@blcham blcham left a comment

Choose a reason for hiding this comment

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

See my suggestions.

}

@Override
public String[] getHeader() throws IOException {
Copy link
Contributor

Choose a reason for hiding this comment

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

should support skipHeader = true

logMissingQuoteError();
return getExecutionContext(inputModel, outputModel);
}
fileReaderAdapter.initialise(new ByteArrayInputStream(sourceResource.getContent()), sourceResourceFormat, processTableAtIndex);
Copy link
Contributor

Choose a reason for hiding this comment

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

Before it was implemented like:

ICsvListReader listReader = getCsvListReader(csvPreference);

            if (listReader == null) {
                logMissingQuoteError();
                return getExecutionContext(inputModel, outputModel);
            }

but there is no reason to have

            if (listReader == null) {
                logMissingQuoteError();
                return getExecutionContext(inputModel, outputModel);
            }

outside of getCsvListReader() method.


tableSchema.adjustProperties(hasInputSchema, outputColumns, sourceResource.getUri());
tableSchema.setColumnsSet(new HashSet<>(outputColumns));
tableSchema.adjustProperties(hasInputSchema, outputColumns, sourceResource.getUri());
Copy link
Contributor

Choose a reason for hiding this comment

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

we lost implementation of listReader.close()

@MSattrtand MSattrtand force-pushed the 228-tabular-data-processing branch from 1f22c86 to 940f458 Compare December 22, 2024 00:56
@MSattrtand MSattrtand closed this Dec 22, 2024
@MSattrtand MSattrtand force-pushed the 228-tabular-data-processing branch from 940f458 to d53c74c Compare December 22, 2024 00:59
@MSattrtand MSattrtand reopened this Dec 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Excel/html files should be processed directly in tabular module
2 participants