We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
【场景】 导入excel文件,表头有6列,但是数据只有前5列有,最后一列数据为空
通过继承AnalysisEventListener类重写invoke方法,读取的的data中,表头map的size为6,第一行数据map的size为5,没有统计最后一列为空的data数据;
【 触发Bug的代码】
public class DynamicReadListener extends AnalysisEventListener<Map<Integer, Object>> { //Excel数据缓存结构 private List<Map<Integer, Map<Integer, Object>>> list; private List<Map<Integer, String>> headList = new ArrayList<>(); //Excel表头(列名)数据缓存结构 private Map<Integer, String> headTitleMap = new HashMap<>(); public DynamicReadListener() { list = new ArrayList<>(); } /** 解析表头外的所有行数据 **/ public void invoke(Map<Integer, Object> data, AnalysisContext context) { Map<Integer, Map<Integer, Object>> map = new HashMap<>(); map.put(context.readRowHolder().getRowIndex(), data); list.add(map); } /** 解析完的后置操作 **/ @Override public void doAfterAllAnalysed(AnalysisContext context) { log.info(HikLog.toLog("all data analysed...")); } /** 解析表头数据 **/ @Override public void invokeHeadMap(Map<Integer, String> headMap, AnalysisContext context) { headTitleMap = headMap; headList.add(headMap); } }
其中headMap的size为6,但是invoke方法获取的data的size为5.
【提示的异常或者没有达到的效果】 怀疑是以下两个地方存在问题:
The text was updated successfully, but these errors were encountered:
It’s definitely a bug, and we’re in the process of evaluating it and working on a fix.
Sorry, something went wrong.
I can't try to reproduce this problem, can you provide a copy of the original excel and the code to read excel @GSLX-LEO
zhuangjiaju
No branches or pull requests
【场景】
导入excel文件,表头有6列,但是数据只有前5列有,最后一列数据为空
通过继承AnalysisEventListener类重写invoke方法,读取的的data中,表头map的size为6,第一行数据map的size为5,没有统计最后一列为空的data数据;
【 触发Bug的代码】
其中headMap的size为6,但是invoke方法获取的data的size为5.
【提示的异常或者没有达到的效果】
怀疑是以下两个地方存在问题:
The text was updated successfully, but these errors were encountered: