deepzliu commented on PR #34555: URL: https://github.com/apache/arrow/pull/34555#issuecomment-1475533675
(My English is not good, with Chinese at the back.) I describe the problem I encountered in detail. When I used both Arrow and RocksDB in my project, I encountered definition conflicts such as LZ4 and SNAPPY. In RocksDB, it is a macro definition, and in Arrow, it is an enumeration. I personally think that in practical applications, this kind of scenario may be more common, it,it's worth to solving this problem. The solutions are as follows: 1) Use some kind of technology to solve it completely with minimal impact, such as the enum class everyone mentioned. According to the my verification results, cannot solve the problem . 2) Modify the macro definitions of other libraries. However, in my opinion, the high maintenance cost and inconvenient usage are not conducive to promotion and application of Arrow library, especially in my case. 3) Add a prefix or suffix to the Arrow library enumeration, such as my PR, the disadvantages are clearly explained; 4) The user ensures that the Arrow header file is referenced at the front of others in the project. The problem with this method is that, a) the quality of developers is very variable and difficult to guarantee; b) if you use the macro definition in the make parameter, there is no solution; To sum up, I personally think that solutions 3 may be a method that can fundamentally solve this problem. --- 我详细描述下我遇到的问题。在我的项目中同时用到了Arrow和RocksDB时,遇到LZ4、SNAPPY等定义冲突,在RocksDB是宏定义,在Arrow中是枚举。 个人认为,在实际应用中,这种场景可能会比较常见,所以解决这个问题有一定的价值。 能想到的解决方法有如下: 1)使用某种技术彻底解决,且影响最小,如大家提到的enum class。从验证结果来看,无法解决该问题; 2)改掉其他库的宏定义。但个人认为维护成本高、使用不便捷,不利于Arrow库广泛推广与应用,尤其是我遇到的情况; 3)在Arrow库枚举上加前缀或后缀,如本PR,弊端大家说得很清楚了; 4)使用者保证在项目中Arrow头文件引用在最前面。这个方法的问题在于,a)开发者水平参差不齐,很难保证;b)如果使用make参数中的宏定义,则无解; 综上所述,个人认为方法3可能是能根本解决该问题的方法。 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
