@Override
    public void emit(String emitKey, List<Metadata> metadataList, ParseContext parseContext)
            throws IOException, TikaEmitterException {
        if (metadataList == null || metadataList.size() < 1) {
            return;
        }
        List<EmitData> emitDataList = new ArrayList<>();
        emitDataList.add(new EmitData(new EmitKey("", emitKey), metadataList));
        emit(emitDataList);
    }
@Test
    public void testBasic(@TempDir Path tmpDir) throws Exception {
        Files.createDirectories(tmpDir.resolve("db"));
        Path dbDir = tmpDir.resolve("db/h2");
        Path config = tmpDir.resolve("tika-config.xml");
        String connectionString = "jdbc:h2:file:" + dbDir.toAbsolutePath();

        writeConfig("/configs/tika-config-jdbc-emitter.xml",
                connectionString, config);

        EmitterManager emitterManager = EmitterManager.load(config);
        Emitter emitter = emitterManager.getEmitter();
        List<String[]> data = new ArrayList<>();
        data.add(new String[]{"k1", "true", "k2", "some string1", "k3", "4", "k4", "100"});
        data.add(new String[]{"k1", "false", "k2", "some string2", "k3", "5", "k4", "101"});
        data.add(new String[]{"k1", "true", "k2", "some string3", "k3", "6", "k4", "102"});
        //test dates with and without timezones
        data.add(new String[]{"k1", "false", "k2", "some string4", "k3", "7", "k4", "103", "k5",
                "100002", "k6", "2022-11-04T17:10:15Z"});

        data.add(new String[]{"k1", "true", "k2", "some string5", "k3", "8", "k4", "104", "k5",
                "100002", "k6", "2022-11-04T17:10:15"});
        int id = 0;
        for (String[] d : data) {
            emitter.emit("id" + id++, Collections.singletonList(m(d)), new ParseContext());
        }

        try (Connection connection = DriverManager.getConnection(connectionString)) {
            try (Statement st = connection.createStatement()) {
                try (ResultSet rs = st.executeQuery("select * from test")) {
                    int rows = 0;
                    while (rs.next()) {
                        assertEquals("id" + rows, rs.getString(1));
                        assertEquals(rows % 2 == 0, rs.getBoolean(2));
                        assertEquals("some string" + (rows + 1), rs.getString(3));
                        assertEquals(rows + 4, rs.getInt(4));
                        assertEquals(100 + rows, rs.getLong(5));
                        if (rows > 2) {
                            assertEquals(100002, rs.getLong(6));
                            Timestamp timestamp = rs.getTimestamp(7);
                            String str = timestamp.toInstant().atZone(ZoneId.of("UTC")).toString();
                            //TODO fix this to work in other timezones
                            assertTrue(str.startsWith("2022-11"));
                        }
                        rows++;
                    }
                }
            }
        }
    }