kou commented on a change in pull request #12457:
URL: https://github.com/apache/arrow/pull/12457#discussion_r812367225



##########
File path: cpp/src/arrow/engine/CMakeLists.txt
##########
@@ -34,78 +28,15 @@ set(ARROW_ENGINE_SRCS
     substrait/relation_internal.cc
     substrait/type_internal.cc)
 
-set(SUBSTRAIT_LOCAL_DIR "${CMAKE_CURRENT_BINARY_DIR}/substrait")
-set(SUBSTRAIT_GEN_DIR "${CMAKE_CURRENT_BINARY_DIR}/generated")
-set(SUBSTRAIT_PROTOS
-    capabilities
-    expression
-    extensions/extensions
-    function
-    parameterized_types
-    plan
-    relations
-    type
-    type_expressions)
-
-externalproject_add(substrait_ep
-                    GIT_REPOSITORY "${ARROW_SUBSTRAIT_REPO}"
-                    GIT_TAG "${ARROW_SUBSTRAIT_TAG}"
-                    SOURCE_DIR "${SUBSTRAIT_LOCAL_DIR}"
-                    CONFIGURE_COMMAND ""
-                    BUILD_COMMAND ""
-                    INSTALL_COMMAND "")
-
-set(SUBSTRAIT_SUPPRESSED_WARNINGS)
-if(MSVC)
-  # Protobuf generated files trigger some spurious warnings on MSVC.
-
-  # Implicit conversion from uint64_t to uint32_t:
-  list(APPEND SUBSTRAIT_SUPPRESSED_WARNINGS "/wd4244")
-
-  # Missing dll-interface:
-  list(APPEND SUBSTRAIT_SUPPRESSED_WARNINGS "/wd4251")
-endif()
-
-file(MAKE_DIRECTORY "${SUBSTRAIT_GEN_DIR}/substrait")
-
-set(SUBSTRAIT_PROTO_GEN_ALL)
-foreach(SUBSTRAIT_PROTO ${SUBSTRAIT_PROTOS})
-  set(SUBSTRAIT_PROTO_GEN 
"${SUBSTRAIT_GEN_DIR}/substrait/${SUBSTRAIT_PROTO}.pb")
-
-  foreach(EXT h cc)
-    set_source_files_properties("${SUBSTRAIT_PROTO_GEN}.${EXT}"
-                                PROPERTIES COMPILE_OPTIONS
-                                           "${SUBSTRAIT_SUPPRESSED_WARNINGS}"
-                                           GENERATED TRUE
-                                           SKIP_UNITY_BUILD_INCLUSION TRUE)
-    add_custom_command(OUTPUT "${SUBSTRAIT_PROTO_GEN}.${EXT}"
-                       COMMAND ${ARROW_PROTOBUF_PROTOC} 
"-I${SUBSTRAIT_LOCAL_DIR}/proto"
-                               "--cpp_out=${SUBSTRAIT_GEN_DIR}"
-                               
"${SUBSTRAIT_LOCAL_DIR}/proto/substrait/${SUBSTRAIT_PROTO}.proto"
-                       DEPENDS ${PROTO_DEPENDS} substrait_ep)
-    list(APPEND SUBSTRAIT_PROTO_GEN_ALL "${SUBSTRAIT_PROTO_GEN}.${EXT}")
-  endforeach()
-
-  list(APPEND ARROW_ENGINE_SRCS "${SUBSTRAIT_PROTO_GEN}.cc")
-endforeach()
-
-add_custom_target(substrait_gen ALL DEPENDS ${SUBSTRAIT_PROTO_GEN_ALL})
-
-find_package(Git)
-add_custom_target(substrait_gen_verify
-                  COMMENT "Verifying that generated substrait accessors are 
consistent with \
-                           
ARROW_SUBSTRAIT_REPO_AND_TAG='${ARROW_SUBSTRAIT_REPO_AND_TAG}'"
-                  COMMAND ${GIT_EXECUTABLE} diff --exit-code 
${SUBSTRAIT_GEN_DIR}
-                  DEPENDS substrait_gen_clear
-                  DEPENDS substrait_gen)
-
 add_arrow_lib(arrow_engine
               CMAKE_PACKAGE_NAME
               ArrowEngine
               PKG_CONFIG_NAME
               arrow-engine
               OUTPUTS
               ARROW_ENGINE_LIBRARIES
+              DEPENDENCIES
+              substrait

Review comment:
       Can we remove this?
   This will be automatically added by using `substrait` target.

##########
File path: cpp/cmake_modules/FindSubstrait.cmake
##########
@@ -0,0 +1,19 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# Currently, we can only build Substrait from source.
+set(SUBSTRAIT_FOUND NO)

Review comment:
       Can we remove this file?
   It seems that this file is never used.




-- 
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: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to