File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -73,6 +73,7 @@ groupBy names df
7373mkRowRep :: [Int ] -> DataFrame -> Int -> Int
7474mkRowRep groupColumnIndices df i = hash (map mkHash groupColumnIndices)
7575 where
76+ getHashedElem :: Column -> Int -> Int
7677 getHashedElem (BoxedColumn (c :: V. Vector a )) j = hash' @ a (c V. ! j)
7778 getHashedElem (UnboxedColumn (c :: VU. Vector a )) j = hash' @ a (c VU. ! j)
7879 getHashedElem (OptionalColumn (c :: V. Vector a )) j = hash' @ a (c V. ! j)
@@ -81,14 +82,14 @@ mkRowRep groupColumnIndices df i = hash (map mkHash groupColumnIndices)
8182
8283-- | This hash function returns the hash when given a non numeric type but
8384-- the value when given a numeric.
84- hash' :: Columnable a => a -> Double
85+ hash' :: Columnable a => a -> Int
8586hash' value = case testEquality (typeOf value) (typeRep @ Double ) of
86- Just Refl -> value
87+ Just Refl -> round $ value * 1000
8788 Nothing -> case testEquality (typeOf value) (typeRep @ Int ) of
88- Just Refl -> fromIntegral value
89+ Just Refl -> value
8990 Nothing -> case testEquality (typeOf value) (typeRep @ T. Text ) of
90- Just Refl -> fromIntegral $ hash value
91- Nothing -> fromIntegral $ hash (show value)
91+ Just Refl -> hash value
92+ Nothing -> hash (show value)
9293
9394mkGroupedColumns :: VU. Vector Int -> DataFrame -> DataFrame -> T. Text -> DataFrame
9495mkGroupedColumns indices df acc name =
You can’t perform that action at this time.
0 commit comments