diff --git a/src/main/java/net/snowflake/client/core/SFBaseResultSet.java b/src/main/java/net/snowflake/client/core/SFBaseResultSet.java
index <HASH>..<HASH> 100644
--- a/src/main/java/net/snowflake/client/core/SFBaseResultSet.java
+++ b/src/main/java/net/snowflake/client/core/SFBaseResultSet.java
@@ -310,7 +310,17 @@ public abstract class SFBaseResultSet
 
     if (obj instanceof String)
     {
-      return Float.parseFloat((String) obj);
+      if ("inf".equals(obj))
+      {
+        return Float.POSITIVE_INFINITY;
+      }
+      else if ("-inf".equals(obj))
+      {
+        return Float.NEGATIVE_INFINITY; }
+      else
+      {
+        return Float.parseFloat((String) obj);
+      }
     }
     else
     {
@@ -331,7 +341,18 @@ public abstract class SFBaseResultSet
 
     if (obj instanceof String)
     {
-      return Double.parseDouble((String) obj);
+      if ("inf".equals(obj))
+      {
+        return Double.POSITIVE_INFINITY;
+      }
+      else if ("-inf".equals(obj))
+      {
+        return Double.NEGATIVE_INFINITY;
+      }
+      else
+      {
+        return Double.parseDouble((String) obj);
+      }
     }
     else
     {
SNOW-<I> Fix the bug that JDBC failed to parse infinite double value