<commit_before>require 'data_objects'

module DataObjects
  module Hana
    
      class Reader < DataObjects::Reader
        def initialize( command, handle)
          @command, @handle = command, handle
          return unless @handle

          @fields = handle.columns
	        DataObjects::Hana.logger.debug("#{command.inspect} and handle is #{handle.inspect}")
          @rows = []
          types = @command.types
          if types && types.size != @fields.size
            close
            raise ArgumentError, "Field-count mismatch. Expected #{types.size} fields, but the query yielded #{@fields.size}"
          end
          DataObjects::Hana.logger.debug("About to fetch rows")
          # Do NOT use @handle.each as it causes a segfault
          while row = @handle.fetch
	          DataObjects::Hana.logger.debug("Row #{row.inspect}")<commit_msg>Attempting to use block syntax instead of fetch calls on statement.<commit_after>require 'data_objects'

module DataObjects
  module Hana
    
      class Reader < DataObjects::Reader
        def initialize( command, handle)
          @command, @handle = command, handle
          return unless @handle

          @fields = @handle.columns
	        DataObjects::Hana.logger.debug("#{@command.inspect} and handle is #{@handle.inspect}")
          @rows = []
          types = @command.types
          if types && types.size != @fields.size
            close
            raise ArgumentError, "Field-count mismatch. Expected #{types.size} fields, but the query yielded #{@fields.size}"
          end
          DataObjects::Hana.logger.debug("About to fetch rows")
          @handle.each do |row|
	          DataObjects::Hana.logger.debug("Row #{row.inspect}")
{'fraction_non_alphanumeric': 0.1070389761489238, 'fraction_numerical': 0.0, 'mean_word_length': 2.359375, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5379559', 'n_tokens_mistral': 456, 'n_tokens_neox': 445, 'n_words': 132}