Elssky commented on PR #657:
URL: 
https://github.com/apache/incubator-graphar/pull/657#issuecomment-2467559950

   > > Hi,@acezen @jasinliu. This should solve the problem in #628, please 
review this.
   > 
   > Thanks! I think you can create some tests following #628 . Or you can 
provide the verification process through comments.
   
   Yes, I used the totally same exmaple in the comment for testing and the 
installation steps are exactly the same, the results show that we can run this 
code correctly
   <img width="723" alt="image" 
src="https://github.com/user-attachments/assets/a62a5c7e-64e1-4696-afa1-17e089ab08ba";>
   ## Other example 
   ### test_read.cc
   ``` cpp
   #include <cstdlib>
   #include <iostream>
   #include "arrow/api.h"
   #include "graphar/api/arrow_reader.h"
   
   
   
   int main() {
       std::string path = 
"/workspaces/incubator-graphar/testing/ldbc_sample/parquet/ldbc_sample.graph.yml";
       std::string src_type = "person", edge_type = "knows", dst_type = 
"person";
       std::string vertex_property_name = "id";
       std::string edge_property_name = "creationDate";
       auto maybe_graph_info = graphar::GraphInfo::Load(path);
       auto graph_info = maybe_graph_info.value();
       auto vertex_info = graph_info->GetVertexInfo(src_type);
   
   
       auto maybe_reader = graphar::VertexPropertyArrowChunkReader::Make(
       graph_info, src_type, vertex_property_name);
       auto reader = maybe_reader.value();
       std::cout << "Chunknum " << reader->GetChunkNum() << std::endl;
   
       auto result = reader->GetChunk();
       auto table = result.value();
       std::cout << "num_rows " << table->num_rows() << std::endl;
   
   }
   ```
   ### CMakeLists.txt
   ```cmake
   cmake_minimum_required(VERSION 3.15)
   
   project(test_read)
   
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -Wall")
   
   set(TARGET test_read)
   
   # find_package(OpenSSL REQUIRED)
   find_package(graphar REQUIRED)
   find_package(Arrow REQUIRED)
   
   add_executable(${TARGET} test_read.cc)
   target_link_libraries(${TARGET} PRIVATE graphar Arrow::arrow_static)
   ```
   ### build
   ```shell 
   cmake . && make
   ```
   <img width="738" alt="image" 
src="https://github.com/user-attachments/assets/bed9478f-b567-4d9f-b973-2cbe1f5cdae3";>
   
   


-- 
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: commits-unsubscr...@graphar.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@graphar.apache.org
For additional commands, e-mail: commits-h...@graphar.apache.org

Reply via email to