public static boolean isWriteOperation(String sql) {
        if (StringUtils.isEmpty(sql)) {
            return false;
        }
        return writePattern.matcher(sql).find();
    }
@Test
    public void testIsWriteOperation() {
        // sql is a write operation
        sql = "INSERT INTO table (name) VALUES ('test')";
        Assert.assertTrue(SqlParserUtils.isWriteOperation(sql));

        sql = "CREATE TABLE table (name VARCHAR(255))";
        Assert.assertTrue(SqlParserUtils.isWriteOperation(sql));

        sql = "DROP INDEX idx_name on table";
        Assert.assertTrue(SqlParserUtils.isWriteOperation(sql));

        // sql is a read operation
        sql = "SELECT * FROM table";
        Assert.assertFalse(SqlParserUtils.isWriteOperation(sql));
    }